<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ivan Zotov on Medium]]></title>
        <description><![CDATA[Stories by Ivan Zotov on Medium]]></description>
        <link>https://medium.com/@ivanzotov?source=rss-cdb227996341------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*9_vqDlZ6wwUC4fAn9M7Jog.jpeg</url>
            <title>Stories by Ivan Zotov on Medium</title>
            <link>https://medium.com/@ivanzotov?source=rss-cdb227996341------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 21:10:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ivanzotov/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Localize an Application Name in React Native]]></title>
            <link>https://medium.com/hackernoon/localize-an-application-name-in-react-native-c36c4b2be7c3?source=rss-cdb227996341------2</link>
            <guid isPermaLink="false">https://medium.com/p/c36c4b2be7c3</guid>
            <category><![CDATA[android-app-development]]></category>
            <category><![CDATA[ios-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Ivan Zotov]]></dc:creator>
            <pubDate>Wed, 23 Aug 2017 14:47:30 GMT</pubDate>
            <atom:updated>2019-04-30T07:18:43.198Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/897/1*23_VmHZeIRtO0HjO0L_-8g.png" /></figure><p>A <a href="https://hackernoon.com/tagged/localization">localization</a> of an application name in a <a href="https://hackernoon.com/tagged/react-native">React Native</a> project and in a native project is a similar process.</p><h4>Localize an iOS application name</h4><p>Create a new file InfoPlist.string in the root folder in XCode:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDX-W3A2HBfRNGpyHijOTw.png" /><figcaption>Creating InfoPlist.string in Xcode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RhKMeYeDhRFC4-pGs4yKSA.png" /></figure><p>Add a default application name to the file, like this:</p><pre>&quot;CFBundleDisplayName&quot; = &quot;Example Application Name&quot;;<br>&quot;CFBundleName&quot; = &quot;Example Application Name&quot;;</pre><p>Where “Example Application Name” is your application name.</p><p>Select the file and press “Localize…” button on the right side.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5DeDj_wRwyh1Y0HEN-ASaA.png" /></figure><p>Then press “Localize” in the popup to add the current file as Base language.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0U0Swfb4YvRzztgOwmtVrw.png" /></figure><p>Change the Display Name as well, because newest iOS versions uses it as a fallback instead of Base language:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8mzT6E1o7pPWC9VOE2sEWA.png" /></figure><p>Now add languages in XCode you want to localize the application name. Press “+” in “Localizations” of Info tab of your project.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UM0u4qGdX_gzKOLPCN8wnw.png" /><figcaption>Adding new language in XCode</figcaption></figure><p>And choose InfoPlist.string file to localize.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJsUfR-G4R2ThIIzVlBfrQ.png" /></figure><p>For each language you added XCode will create a file for InfoPlist.strings. Change the content of localized files:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gHjvplvN79PbeCM3aOLZnw.png" /></figure><p>That’s all!</p><h4>Localize an Android application name</h4><p>By default an Android application name is in strings.xml file ./android/app/src/main/res/values/strings.xml:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kc8gy4khOLdvTynQtOsV0A.png" /></figure><p>Similar to iOS, we’re going to localize strings file. Let’s create a new folder inside res with name like values-de , where de is a language you want to localize, it’s Deutsch in our case (<a href="http://www.loc.gov/standards/iso639-2/php/code_list.php">full list of codes</a>).</p><p>Copy strings.xml to the folder, and change the application name.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6GuXuEjjQm_hagTQVyVF0Q.png" /></figure><p>Done. <a href="https://developer.android.com/training/basics/supporting-devices/languages.html">More info about Android localization</a></p><p>Thanks.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c36c4b2be7c3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/localize-an-application-name-in-react-native-c36c4b2be7c3">Localize an Application Name in React Native</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Simple Android Call Recorder in React Native (HeadlessJS task)]]></title>
            <link>https://codeburst.io/simple-android-call-recorder-in-react-native-headlessjs-task-614bcc56efc4?source=rss-cdb227996341------2</link>
            <guid isPermaLink="false">https://medium.com/p/614bcc56efc4</guid>
            <category><![CDATA[android]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Ivan Zotov]]></dc:creator>
            <pubDate>Wed, 16 Aug 2017 08:02:13 GMT</pubDate>
            <atom:updated>2017-08-17T17:55:37.064Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>I use React Native 0.47.1 in the article, if it doesn’t work for your version, please let me know.</blockquote><p>In this article I want to show you how to build a simple Android service using React Native for call recording. Call recording is a complex task, so we’ll make a very simple one that uses MIC as a source. Our goal is to understand how to use a broadcast receiver and services together with React Native. Let’s get started!</p><blockquote>Not all devices and Android versions support call recording, you can hear only your side of a phone call, but it’s not a big deal in our case, right?</blockquote><h3>Preparation</h3><h4>Install dependencies</h4><p>Let’s make a new RN project with</p><pre>react-native init CallRecorder</pre><p>Once the app is Android only, we can completely remove an iOS folder and index.ios.js:</p><pre>rm -R ./ios index.ios.js</pre><p>We’re going to record an audio and play so we need two modules for it:</p><pre>npm install --save react-native-audio react-native-sound</pre><p>We have to link these libraries, because they use a native code:</p><pre>react-native link</pre><h4>Add permissions</h4><p>To record audio and calls we need some permissions, add them to AndroidManifest.xml right after other uses-permissions:</p><p>CallRecorder/android/app/src/main/AndroidManifest.xml</p><pre>&lt;uses-permission android:name=&quot;android.permission.RECORD_AUDIO&quot; /&gt;<br>&lt;uses-permission android:name=&quot;android.permission.PROCESS_OUTGOING_CALLS&quot; /&gt;<br>&lt;uses-permission android:name=&quot;android.permission.READ_PHONE_STATE&quot; /&gt;<br>&lt;uses-permission android:name=&quot;android.permission.WAKE_LOCK&quot; /&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OY9WTJwWABBFFWOq9C-x_g.png" /></figure><blockquote>Make sure your targetSdkVersion is 22 in app build.gradle, because if it is above these permissions wouldn’t work, you have to ask permissions in runtime else.</blockquote><p>CallRecorder/android/app/build.gradle</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UUfdnjB90iV_weN4Nvijgw.png" /></figure><h3>Creating service and receiver</h3><p>In simple words Android service is a code kept in background and receiver is a code that will execute itself when some of registered events is fired. So in our case the receiver will call our service when something happened like a new outgoing call is started or a phone state is changed (for example, a phone is picked up).</p><h4>Registering</h4><p>First of all, we have to register them in AndroidManifest.xml inside application:</p><pre>&lt;service android:name=&quot;com.callrecorder.service.RecService&quot; /&gt;<br>&lt;receiver android:name=&quot;com.callrecorder.receiver.RecReceiver&quot;&gt;<br>  &lt;intent-filter android:priority=&quot;0&quot;&gt;<br>    &lt;action android:name=&quot;android.intent.action.PHONE_STATE&quot; /&gt;<br>    &lt;action android:name=&quot;android.intent.action.NEW_OUTGOING_CALL&quot; /&gt;<br>  &lt;/intent-filter&gt;<br>&lt;/receiver&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4QKgm-KpjjFgG1gs3Qajaw.png" /></figure><p>Now let’s register our JS task, add these lines to index.android.js:</p><pre>const Rec = async (data) =&gt; {<br>  console.log(&#39;It works!&#39;)<br>}</pre><pre>AppRegistry.registerHeadlessTask(&#39;Rec&#39;, () =&gt; Rec)</pre><h4>Write code</h4><p>Create two files:</p><pre>java/com/callrecorder/service/RecService.java</pre><pre>java/com/callrecorder/receiver/RecReceiver.java</pre><p>Add this code into RecService, just like documentation says (<a href="https://facebook.github.io/react-native/docs/headless-js-android.html">https://facebook.github.io/react-native/docs/headless-js-android.html</a>):</p><pre>package com.callrecorder.service;</pre><pre>import android.content.Intent;<br>import android.os.Bundle;<br>import com.facebook.react.HeadlessJsTaskService;<br>import com.facebook.react.bridge.Arguments;<br>import com.facebook.react.jstasks.HeadlessJsTaskConfig;<br>import javax.annotation.Nullable;</pre><pre>public class RecService extends HeadlessJsTaskService {<br>    <a href="http://twitter.com/Nullable">@Nullable</a><br>    protected HeadlessJsTaskConfig getTaskConfig(Intent intent) {<br>        Bundle extras = intent.getExtras();<br>        return new HeadlessJsTaskConfig(<br>          &quot;Rec&quot;,<br>          extras != null ? Arguments.fromBundle(extras) : null,<br>          5000);<br>    }<br>}</pre><p>The main part here is new HeadlessJsTaskConfig(&quot;Rec&quot;, extras != null ? Arguments.fromBundle(extras) : null, 5000); it will call our JS task, that’s all we want from RecService.</p><p>And here is code for our RecReceiver:</p><pre>package com.callrecorder.receiver;</pre><pre>import android.content.BroadcastReceiver;<br>import android.content.Context;<br>import android.content.Intent;<br>import com.callrecorder.service.RecService;<br>import com.facebook.react.HeadlessJsTaskService;</pre><pre>public final class RecReceiver extends BroadcastReceiver {<br>    public final void onReceive(Context context, Intent intent) {<br>        Intent recIntent = new Intent(context, RecService.class);<br>        context.startService(recIntent);<br>        HeadlessJsTaskService.acquireWakeLockNow(context);<br>    }<br>}</pre><p>Now it’s just calls our RecService if some of events is happened.</p><h4>First run</h4><p>Run your app with react-native run-android</p><blockquote>If you have an error such as method does not override or implement a method from a supertype it means react-native-audio doesn’t merge PR like <a href="https://github.com/jsierles/react-native-audio/pull/206">https://github.com/jsierles/react-native-audio/pull/206</a>, so probably you have to manually patch it</blockquote><p>Enable Remote JS Debugging mode and try to call to someone, on a new outgoing call and any phone state changes our JS function will be executed and you can see “It works!” several times in a console output.</p><p>So it’s time to record a call.</p><h3>Recording</h3><p>Once a JS task is executed on both “new outgoing call” and “phone state change” we want to know which event called our function. As you can see we have a data argument const Rec = async (data) =&gt; { , now it’s null, to pass some params to it we add a code like this to the receiver:</p><pre>if (intent.getAction().equals(&quot;android.intent.action.PHONE_STATE&quot;)) {<br>  recIntent.putExtra(&quot;action&quot;, &quot;phone_state&quot;);<br>} else {<br>  recIntent.putExtra(&quot;action&quot;, &quot;new_outgoing_call&quot;);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mPXntsUgVc8YpIj_5luGxQ.png" /></figure><p>Let’s output data now:</p><pre>const Rec = async (data) =&gt; {<br>  console.log(&#39;DATA:&#39;, data)<br>}</pre><p>Now we know what action the function is processing using data.action, it’ll be either phone_state or new_outgoing_call</p><p>We also want to determine if it’s an outgoing or incoming call, what phone state is ‘ringing’, ‘offhook’ or ‘idle’ and what incoming phone number is. Let’s add some code for it:</p><pre>...<br>import android.telephony.TelephonyManager;<br>...</pre><pre>if (intent.getAction().equals(&quot;android.intent.action.PHONE_STATE&quot;)) {<br>  recIntent.putExtra(&quot;action&quot;, &quot;phone_state&quot;);<br>  String phoneState = intent.getStringExtra(&quot;state&quot;);<br>  if (phoneState.equals(TelephonyManager.EXTRA_STATE_RINGING)) {<br>    String phoneNumber = intent.getStringExtra(&quot;incoming_number&quot;);<br>    incomingCall = true;<br>    recIntent.putExtra(&quot;state&quot;, &quot;extra_state_ringing&quot;);<br>    recIntent.putExtra(&quot;incoming_call&quot;, true);<br>    recIntent.putExtra(&quot;number&quot;, phoneNumber);<br>  } else if (phoneState.equals(TelephonyManager.EXTRA_STATE_OFFHOOK)) {<br>    if (incomingCall) {<br>      incomingCall = false;<br>    }<br>    recIntent.putExtra(&quot;state&quot;, &quot;extra_state_offhook&quot;);<br>    recIntent.putExtra(&quot;incoming_call&quot;, false);<br>  } else if (phoneState.equals(TelephonyManager.EXTRA_STATE_IDLE)) {<br>    if (incomingCall) {<br>      incomingCall = false;<br>    }<br>    recIntent.putExtra(&quot;state&quot;, &quot;extra_state_idle&quot;);<br>    recIntent.putExtra(&quot;incoming_call&quot;, false);<br>  }<br>} else {<br>  recIntent.putExtra(&quot;action&quot;, &quot;new_outgoing_call&quot;);<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RkmUmbIgCn8DjKpS7LKZXg.png" /></figure><p>Finally, to start our recording let’s rewrite the Rec function:</p><pre>import { AudioRecorder, AudioUtils } from &#39;react-native-audio&#39;</pre><pre>const audioPath = AudioUtils.DocumentDirectoryPath + &#39;/record.aac&#39;</pre><pre>const Rec = async (data) =&gt; {<br>  if (data.state === &#39;extra_state_offhook&#39;) {<br>    AudioRecorder.prepareRecordingAtPath(audioPath, {<br>      SampleRate: 22050,<br>      Channels: 1,<br>      AudioQuality: &quot;Low&quot;,<br>      AudioEncoding: &quot;aac&quot;<br>    })</pre><pre>    await AudioRecorder.startRecording()<br>  } else if (data.state === &#39;extra_state_idle&#39;) {<br>    await AudioRecorder.stopRecording()<br>  }<br>}</pre><p>And add some code to the main component to play the record:</p><pre>import Sound from &#39;react-native-sound&#39;</pre><pre>export default class CallRecorder extends Component {<br>  onPress = () =&gt; {<br>    // These timeouts are a hacky workaround for some issues with react-native-sound.<br>    // See <a href="https://github.com/zmxv/react-native-sound/issues/89">https://github.com/zmxv/react-native-sound/issues/89</a>.<br>    setTimeout(() =&gt; {<br>      const sound = new Sound(audioPath, &#39;&#39;)</pre><pre>setTimeout(() =&gt; {<br>        sound.play((success) =&gt; {<br>          if (!success) Alert.alert(&#39;Error&#39;, &#39;no records found&#39;)<br>        })<br>      }, 100)<br>    }, 100)<br>  }</pre><pre>render() {<br>    return (<br>      &lt;View style={styles.container}&gt;<br>        &lt;Button title=&#39;Play the last record&#39; onPress={this.onPress} /&gt;<br>      &lt;/View&gt;<br>    );<br>  }<br>}</pre><p>Final code is here:</p><p><a href="https://github.com/ivanzotov/CallRecorder">ivanzotov/CallRecorder</a></p><p>Thanks. You can play with data arguments to save a phone number etc. Comments are welcome!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=614bcc56efc4" width="1" height="1" alt=""><hr><p><a href="https://codeburst.io/simple-android-call-recorder-in-react-native-headlessjs-task-614bcc56efc4">Simple Android Call Recorder in React Native (HeadlessJS task)</a> was originally published in <a href="https://codeburst.io/">codeburst</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[React Native Deep Linking with Nested Navigators]]></title>
            <link>https://medium.com/@ivanzotov/react-native-deep-linking-with-authorization-screen-drawer-and-nested-navigators-in-react-4f702b1520a0?source=rss-cdb227996341------2</link>
            <guid isPermaLink="false">https://medium.com/p/4f702b1520a0</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-navigation]]></category>
            <category><![CDATA[deep-linking]]></category>
            <category><![CDATA[react-native]]></category>
            <dc:creator><![CDATA[Ivan Zotov]]></dc:creator>
            <pubDate>Tue, 15 Aug 2017 07:32:21 GMT</pubDate>
            <atom:updated>2017-08-16T14:01:29.149Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Before reading the article I assume that you’ve already set up deep linking with the docs <a href="https://reactnavigation.org/docs/guides/linking#iOS">https://reactnavigation.org/docs/guides/linking#iOS</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGHQn5AyQrVAQuPvdJPXAg.png" /><figcaption>Deep Linking</figcaption></figure><p>I spent some time on making deep linking work properly using react-navigation in my project where there are nested navigators and additional screens that I have to display before opening the desired screen, like a preloader and authorization. So I’ll tell you here how to do that, hope it saves your time.</p><p>Let’s say we have a preloader stack component in index.js file:</p><pre>export default function app() {<br> return (&lt;PreloaderStack /&gt;)<br>}</pre><p>And preloader stack looks like this:</p><pre>const PreloaderStack = StackNavigator({<br> Preloader: { screen: Preloader },<br> Auth: { screen: Auth },<br> Drawer: {<br>   screen: () =&gt; (&lt;Drawer uriPrefix={‘myapp://’} /&gt;),<br>   navigationOptions: { header: null },<br> },<br>})</pre><p>As you can see we added uriPrefix to our Drawer component because it is where we want deep linking to start working. So every time the app is opened with deep links, it’s loading normally with Preloader screen that navigates to Auth stack, which in its turn navigates to Drawer. Once the Drawer has uriPrefix property, it determines which screen it has to open, here is how Drawer stack looks like:</p><pre>const Drawer = DrawerNavigator({<br> MainStack: { screen: MainStack },<br> ContactsStack: { screen: ContactsStack, path: ‘contacts’ },<br> SettingsStack: { screen: SettingsStack, path: ‘settings’ },<br>})</pre><p>If you set up deep linking correctly, opening an URL like myapp://settings will open your app and then the settings screen within Drawer stack after preloading and authorization has completed.</p><p>And the last thing we are going to do is adding nested navigator:</p><pre>const SettingsStack = StackNavigator({<br>  Settings: { screen: Settings },<br>  Language: { screen: Language, path: &#39;language&#39; },<br>})</pre><p>To open a language screen just open an URL myapp://settings/language, as you can see first screens in our StackNavigator like Settings and MainStack have no path property. So after opening the URL our navigation stack will be Main &gt; Settings &gt; Language.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4f702b1520a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Text Input Mask for React Native]]></title>
            <link>https://medium.com/cloudboost/text-input-mask-for-react-native-3c04e82843a6?source=rss-cdb227996341------2</link>
            <guid isPermaLink="false">https://medium.com/p/3c04e82843a6</guid>
            <category><![CDATA[mobile-app-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Ivan Zotov]]></dc:creator>
            <pubDate>Sun, 13 Aug 2017 20:07:22 GMT</pubDate>
            <atom:updated>2017-08-24T07:31:06.932Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VVqqeKJsVCG-qrm6uqxB5A.png" /></figure><p>When I first time got a task in the project I was working on to make a masked text input in React Native, I absolutely didn’t expect that it would be so difficult to implement. I just thought “ok, will install some RN module or make it by myself using onChangeText”, yep…</p><p>After many attempts with methods of TextInput like onChangeText, onKeyPress, selection I finally did it with not good performance for iOS, but not for Android, because onKeyPress method of TextInput is not implemented for Android yet. More over there was no selection property yet in the version of React Native I was working on to change a position of carriage, so I had to write it by myself in Objective-C and Java, imagine how I was wondering when saw it in the next version of RN :)</p><p>I didn’t find any solution and module that fits my needs to close the task so decided to write my own one, here it is:</p><blockquote>UPD: now it’s under react-native-community</blockquote><p><a href="https://github.com/react-native-community/react-native-text-input-mask">react-native-community/react-native-text-input-mask</a></p><blockquote>0.47+ version of React Native is required</blockquote><p>I’ve just integrated these great native RedMadRobot’s libraries to React Native:</p><ul><li><a href="https://github.com/RedMadRobot/input-mask-android">GitHub - RedMadRobot/input-mask-android: User input masking library repo.</a></li><li><a href="https://github.com/RedMadRobot/input-mask-ios">RedMadRobot/input-mask-ios</a></li></ul><h3>Installation</h3><pre>npm install --save react-native-text-input-mask<br>react-native link react-native-text-input-mask</pre><p>For Android it just works.</p><p>For iOS you have to drag and drop InputMask framework to Embedded Binaries in General tab of Target and check ‘Yes’ in ‘Always Embed Swift Standart Libraries’ of Build Settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J0TPrRhkAKspVvv-JaZHjA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*j7VdY3g9_Vz6YTki3T17CQ.png" /></figure><p><em>Actually, I don’t understand how to get rid of the step building the module, need help </em><a href="https://hashnode.com/post/how-to-link-a-dependency-automatically-in-react-native-module-cj6q4jslk00u2mpwt2hvaayfz">https://hashnode.com/post/how-to-link-a-dependency-automatically-in-react-native-module-cj6q4jslk00u2mpwt2hvaayfz</a></p><h3>Example</h3><pre>import TextInputMask from &#39;react-native-text-input-mask&#39;;<br>...<br>&lt;TextInputMask mask={&quot;+1 ([000]) [000] [00] [00]&quot;} /</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*j6Go2aYlJnJablpTixdRsg.gif" /></figure><p>Thanks. Hope it helps, any comments, issues, PR are welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3c04e82843a6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudboost/text-input-mask-for-react-native-3c04e82843a6">Text Input Mask for React Native</a> was originally published in <a href="https://medium.com/cloudboost">CloudBoost</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Adding ES7 Decorator support to a React Native project]]></title>
            <link>https://medium.com/cloudboost/adding-es7-decorator-support-to-a-react-native-project-de537e958da0?source=rss-cdb227996341------2</link>
            <guid isPermaLink="false">https://medium.com/p/de537e958da0</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[web-development]]></category>
            <dc:creator><![CDATA[Ivan Zotov]]></dc:creator>
            <pubDate>Sun, 13 Aug 2017 08:35:42 GMT</pubDate>
            <atom:updated>2020-07-16T15:04:15.395Z</atom:updated>
            <content:encoded><![CDATA[<p>Decorators make your code much neater, I use decorators with Redux (usually with Ramda pick function), for example:</p><pre>import pick from &#39;ramda/src/pick&#39;</pre><pre>@connect(pick([‘myReducer’]))<br>export default class MyComponent extends PureComponent {<br>   render() {<br>      return (&lt;Text&gt;{this.props.myReducer}&lt;/Text&gt;)<br>   }<br>}</pre><p>To add decorator support in a React Native project just install babel-preset-react-native-stage-0 package:</p><pre>npm install --save-dev babel-preset-react-native-stage-0</pre><p>and change file .babelrc to:</p><pre>{<br>  &quot;presets&quot;: [&quot;react-native-stage-0/decorator-support&quot;]<br>}</pre><p>If you’re not familiar with decorators, it’s just a function that takes as an argument what it decorates:</p><pre>@myFunction<br>class MyClass { }</pre><p>is equivalent to:</p><pre>class MyClass { }</pre><pre>myFunction(MyClass)</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de537e958da0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/cloudboost/adding-es7-decorator-support-to-a-react-native-project-de537e958da0">Adding ES7 Decorator support to a React Native project</a> was originally published in <a href="https://medium.com/cloudboost">CloudBoost</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>