<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: MTA Team</title>
    <description>The latest articles on Forem by MTA Team (@mtateam1).</description>
    <link>https://forem.com/mtateam1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F415300%2F225b51a6-1eb6-487e-b4bc-e1924b21aca6.jpg</url>
      <title>Forem: MTA Team</title>
      <link>https://forem.com/mtateam1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mtateam1"/>
    <language>en</language>
    <item>
      <title>Adding Redux to your React Native App</title>
      <dc:creator>MTA Team</dc:creator>
      <pubDate>Tue, 28 Jul 2020 15:21:47 +0000</pubDate>
      <link>https://forem.com/mtateam1/adding-redux-to-your-react-native-app-270f</link>
      <guid>https://forem.com/mtateam1/adding-redux-to-your-react-native-app-270f</guid>
      <description>&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Arn81KthOlgxpSJZ1RHVtTQ.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F2000%2F1%2Arn81KthOlgxpSJZ1RHVtTQ.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Why Do We Need Global State ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If we want to pass a data to a component from another one, we have few options. If they have a relation then it’s easy, we just pass the data as a prop. But as the complexity grows it is harder to track down the component tree and props. What if the components don’t have a relation? That’s where global state comes into play. Imagine Redux global store as a component at higher level than all of your componets and you can pass and fetch any data from there via actions and reducers at any level. In this article we will show you how to add and use Redux in your React Native App.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;How To Install React-Redux&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Open your project folder in your terminal and run commands below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install redux react-redux redux-persist @react-native-community/async-storage --save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;What Are Reducers and Actions ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;A &lt;strong&gt;reducer&lt;/strong&gt; is a function that determines changes to an application’s state. It uses the &lt;strong&gt;action&lt;/strong&gt; it receives to determine this change.&lt;/p&gt;

&lt;p&gt;As you go deep in Redux, you’ll find out that all you’re going to do will be in reducers and actions. If you can grasp these concepts well, you’ll master redux in no time. Let’s start.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Write Your First Reducer&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Let’s create a folder named &lt;strong&gt;redux **in project level and inside that two more folders named **actions **and **reducers. **In reducers folder create a file. Let’s name it **userReducer&lt;/strong&gt;. We’ll use this reducer to pass down a string(name) and a boolean(loggedIn) value.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1016%2F1%2ALie38cd_NrOkzQkJvkLkIg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1016%2F1%2ALie38cd_NrOkzQkJvkLkIg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;At the top we will define an Initial state for default values. After that we’ll define our reducer.&lt;/p&gt;

&lt;p&gt;Our reducer will have two parameters. First one is our state and the second one is the action that triggers our state changes. We change our state based on the type of action.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Write Your First Action&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In actions folder create a file named &lt;strong&gt;userActions&lt;/strong&gt;. We have two actions, first one is for passing down the username to the reducer and second one is for resetting the reducer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F664%2F1%2AnimBBMZs9moh6y0-fh13ww.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F664%2F1%2AnimBBMZs9moh6y0-fh13ww.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Root Reducer&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you have more than one reducer in your app then you need to create a root reducer to combine all your reducers. In reducers folder create another file named rootReducer.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F658%2F1%2APUncXiNxzVeUnqcFHCb2Hw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F658%2F1%2APUncXiNxzVeUnqcFHCb2Hw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note that when you export, left side of the object is how you will call the reducer state in components.&lt;/em&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;What is Redux-Persist ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you want to keep your data in redux even if you close your app you need redux-persist. In redux-persist you can decide which data you’ll keep and which data you’ll lose.&lt;/p&gt;

&lt;p&gt;In redux folder create a file named store.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1102%2F1%2AZnrWFG-Lv71etGdR6bCPfA.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1102%2F1%2AZnrWFG-Lv71etGdR6bCPfA.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now it’s time to wrap our app with the store we created.&lt;/p&gt;

&lt;p&gt;Let’s open our App.js file. To access redux data from all components we should wrap our app with Provider and give store as a prop.&lt;/p&gt;

&lt;p&gt;And for redux-persist, at a level below we wrap our app with PersistGate and give persistor as prop and set loading prop as null.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1048%2F1%2Aei4LCH07VA2DQILbCKu38g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1048%2F1%2Aei4LCH07VA2DQILbCKu38g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now we’re ready to use our reducers and actions in our app.&lt;/p&gt;

&lt;p&gt;So let’s use them.&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;What are MapStateToProps and MapDispachToProps ?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;How To Send Data To Redux Store?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In this example we have a text input and a button for user to type their name and proceed with their name. We have a component called landingPage. In this file before we use actions we have to import them.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F950%2F1%2ATNLHhznUTviQT_coCC7ctg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F950%2F1%2ATNLHhznUTviQT_coCC7ctg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For triggering the action we need to use **mapDispatchToProps **function and to get the data from redux store we need to use **mapStateToProps **function.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F662%2F1%2AK9EmUqdZ39f18LrjqTJE-g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F662%2F1%2AK9EmUqdZ39f18LrjqTJE-g.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;**Dispatch **is a function that will trigger our actions. We pass a parameter to the reducer.The reducer will use that parameter once the action is triggered.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1082%2F1%2Ap1RSo3V0ChZKTFZZkz_NCg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1082%2F1%2Ap1RSo3V0ChZKTFZZkz_NCg.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using action is quite easy. We just need to define it from props and use it as a function. As you can see in the image above we pass the username state as parameter and call action. This will trigger our action and go to the reducer with the username data.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;How To Receive Data From Redux Store?&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We have a second page to show user name in another component.&lt;/p&gt;

&lt;p&gt;For getting the data from redux store we need to use **mapStateToProps **function. We will get user from state of our store.&lt;/p&gt;

&lt;p&gt;And for logout we also define resetUserAction.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F672%2F1%2A2b7el4g5TOBfNA4wl_S04w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F672%2F1%2A2b7el4g5TOBfNA4wl_S04w.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1054%2F1%2Ae2pm9XGYdyHZXlBR8lAEcw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F1054%2F1%2Ae2pm9XGYdyHZXlBR8lAEcw.png"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Using data from redux store is also quite easy. Like action; just define it from props and use it wherever you want.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F600%2F1%2ALkV08Jil39VuLr9sN8D-6g.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fcdn-images-1.medium.com%2Fmax%2F600%2F1%2ALkV08Jil39VuLr9sN8D-6g.gif"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;Conclusion:&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;We tried to show and explain how to use Redux in React-Native. Redux may take some time to learn but with practice and time you will master your skills. For more information use can check the Redux documents &lt;a href="https://redux.js.org/introduction/getting-started" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You can clone this project from &lt;a href="https://github.com/mtateam/react-native-examples" rel="noopener noreferrer"&gt;*&lt;em&gt;here *&lt;/em&gt;&lt;/a&gt;via github*&lt;em&gt;.&lt;/em&gt;*&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;MTA Team:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/u/780987e259b0?source=post_page-----6e15f3fbf9e1----------------------" rel="noopener noreferrer"&gt;Ali Gümüş Tosun&lt;/a&gt; - &lt;a href="https://medium.com/u/f07974fc764c?source=post_page-----6e15f3fbf9e1----------------------" rel="noopener noreferrer"&gt;Semih Sevincli&lt;/a&gt; - &lt;a href="https://medium.com/u/fca2225fd420?source=post_page-----6e15f3fbf9e1----------------------" rel="noopener noreferrer"&gt;Aslancan Yılmaz&lt;/a&gt; - &lt;a href="https://medium.com/u/e86295cf2fe8?source=post_page-----6e15f3fbf9e1----------------------" rel="noopener noreferrer"&gt;Burak Arıcı&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LinkedIn Accounts:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.linkedin.com/in/ali-g%C3%BCm%C3%BC%C5%9F-tosun-9a6736129/" rel="noopener noreferrer"&gt;Ali Gümüş Tosun&lt;/a&gt; - &lt;a href="https://www.linkedin.com/in/semih-sevin%C3%A7li-02a0a4ba/" rel="noopener noreferrer"&gt;Semih Sevinçli&lt;/a&gt; - &lt;a href="https://www.linkedin.com/in/aslancan-y%C4%B1lmaz-002965131/" rel="noopener noreferrer"&gt;Aslancan Yılmaz&lt;/a&gt; - &lt;a href="https://www.linkedin.com/in/mustafa-burak-ar%C4%B1c%C4%B1-40889618b/" rel="noopener noreferrer"&gt;Burak Arıcı&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Setting Up Navigation for React Native App</title>
      <dc:creator>MTA Team</dc:creator>
      <pubDate>Sun, 28 Jun 2020 20:51:53 +0000</pubDate>
      <link>https://forem.com/mtateam1/setting-up-navigation-for-react-native-app-1doa</link>
      <guid>https://forem.com/mtateam1/setting-up-navigation-for-react-native-app-1doa</guid>
      <description>
&lt;p id="97c6" class="graf graf--p graf-after--figure"&gt;&lt;em class="markup--em markup--p-em"&gt;After reading this tutorial, you will have basic understanding about react navigation stack.&lt;/em&gt;&lt;/p&gt;
&lt;blockquote id="2c24" class="graf graf--blockquote graf-after--p"&gt;Prerequisites :&lt;/blockquote&gt;
&lt;p id="912a" class="graf graf--p graf-after--blockquote"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;Android Studio Environment:&lt;/strong&gt;&lt;/p&gt;
&lt;p id="83bc" class="graf graf--p graf-after--p"&gt;You can follow &lt;a href="https://medium.com/@MtaTeam/6e15f3fbf9e1" class="markup--anchor markup--p-anchor" rel="noopener"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;this&lt;/strong&gt; &lt;/a&gt;article’s prerequisites section for setting up Android Studio, JDK &amp;amp; environment variables and creating a React Native project.&lt;/p&gt;
&lt;p id="b4fb" class="graf graf--p graf-after--p"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;Npm Packages :&lt;/strong&gt;&lt;/p&gt;
&lt;p id="4a42" class="graf graf--p graf-after--p"&gt;react-native-reanimated, react-native-gesture-handler, react-native-screens, react-native-safe-area-context,@react-native-community/masked-view, react-navigation&lt;/p&gt;
&lt;p id="7cc5" class="graf graf--p graf-after--p"&gt;We need to install the dependencies first:&lt;/p&gt;
&lt;pre id="538d" class="graf graf--pre graf-after--p"&gt;&lt;code class="markup--code markup--pre-code"&gt;npm i react-native-reanimated react-native-gesture-handler react-native-screens react-native-safe-area-context @react-native-community/masked-view&lt;/code&gt;&lt;/pre&gt;
&lt;p id="5196" class="graf graf--p graf-after--pre"&gt;and then:&lt;/p&gt;
&lt;pre id="b97b" class="graf graf--pre graf-after--p"&gt;npm i @react-navigation/native @react-navigation/stack&lt;/pre&gt;
&lt;p id="0516" class="graf graf--p graf-after--pre"&gt;After you install an npm package, you need to rebuild your project and re-run.&lt;/p&gt;
&lt;p id="53e4" class="graf graf--p graf-after--p"&gt;&lt;em class="markup--em markup--p-em"&gt;Note that if you currently have more than one programs reading your project files, below command may give error.&lt;/em&gt;&lt;/p&gt;
&lt;pre id="1b84" class="graf graf--pre graf-after--p"&gt;cd android&lt;br&gt;gradlew assembleDebug&lt;/pre&gt;
&lt;p id="98ea" class="graf graf--p graf-after--pre"&gt;If you get any errors,&lt;/p&gt;
&lt;pre id="a6e2" class="graf graf--pre graf-after--p"&gt;gradlew clean&lt;/pre&gt;
&lt;p id="8213" class="graf graf--p graf-after--pre"&gt;and re-run&lt;/p&gt;
&lt;pre id="0a3e" class="graf graf--pre graf-after--p"&gt;gradlew assembleDebug&lt;/pre&gt;
&lt;p id="8ac4" class="graf graf--p graf-after--pre"&gt;We should import react-native-gesture-handler at the very beginning of our project(App.js or index.js)&lt;/p&gt;
&lt;p id="60e3" class="graf graf--p graf-after--p"&gt;Open app.js and in the first line enter:&lt;/p&gt;
&lt;pre id="291e" class="graf graf--pre graf-after--p"&gt;import 'react-native-gesture-handler';&lt;/pre&gt;
&lt;p id="6d15" class="graf graf--p graf-after--pre"&gt;Then wrap our whole application with NavigationContainer after we import it.&lt;/p&gt;
&lt;p id="2726" class="graf graf--p graf-after--p"&gt;We also need to create a router which will define the screens for our navigation.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--VzDPk_qa--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2Aw3AnKHWDgzHVsfVYuK605w.png"&gt;App.js&lt;p id="324b" class="graf graf--p graf-after--figure"&gt;In our router we import &lt;strong class="markup--strong markup--p-strong"&gt;createStackNavigator &lt;/strong&gt;and initialize a stack with that function.&lt;/p&gt;
&lt;p id="b0fe" class="graf graf--p graf-after--p"&gt;After we initialize our &lt;strong class="markup--strong markup--p-strong"&gt;Stack &lt;/strong&gt;we can call &lt;strong class="markup--strong markup--p-strong"&gt;&amp;lt;Stack.Navigator&amp;gt;&lt;/strong&gt; and create Screens for every page we have in our app.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--TrUDQgdM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2Aq5w1XbbyOlkKWrWn7uP5mw.png"&gt;Router.js&lt;p id="d7ce" class="graf graf--p graf-after--figure"&gt;In &lt;strong class="markup--strong markup--p-strong"&gt;Stack.Screen&lt;/strong&gt; we have two required props: &lt;strong class="markup--strong markup--p-strong"&gt;name &lt;/strong&gt;and &lt;strong class="markup--strong markup--p-strong"&gt;component.&lt;/strong&gt;&lt;/p&gt;
&lt;p id="0b7f" class="graf graf--p graf-after--p"&gt;Name is the string that we will call our screen with, component is the component that will be rendered when we navigate to the screen.&lt;/p&gt;
&lt;p id="6fe0" class="graf graf--p graf-after--p"&gt;Since we wrapped our whole app with NavigationContainer in App.js file, we can use navigation functions in all pages.&lt;/p&gt;
&lt;p id="6009" class="graf graf--p graf-after--p"&gt;We created a function and called this.props.navigation.navigate(‘SecondPage’);&lt;/p&gt;
&lt;p id="9b4d" class="graf graf--p graf-after--p"&gt;&lt;em class="markup--em markup--p-em"&gt;Note that ‘SecondPage’ is the name of our other Stack screen.&lt;/em&gt;&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--QsLK1p_1--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AQX5i4tjSRvMWSnWM4MvehA.png"&gt;LandingPage.js&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--peYWYsPb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2AsKAtZTCxksPKzsnmKA73lw.png"&gt;SecondPage.js&lt;p id="cca5" class="graf graf--p graf-after--figure"&gt;then:&lt;/p&gt;
&lt;pre id="9e09" class="graf graf--pre graf-after--p"&gt;cd ..&lt;br&gt;react-native run-android&lt;/pre&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--GRFKSns8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://cdn-images-1.medium.com/max/800/1%2A2Vvqs3i09wFfW6vLjyzALw.gif"&gt;&lt;p id="1cbc" class="graf graf--p graf-after--figure"&gt;You can clone this project from &lt;a href="https://github.com/mtateam/react-native-navigation" class="markup--anchor markup--p-anchor" rel="noopener"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;strong class="markup--strong markup--p-strong"&gt; &lt;/strong&gt;via github&lt;strong class="markup--strong markup--p-strong"&gt;.&lt;/strong&gt;&lt;/p&gt;
&lt;p id="5063" class="graf graf--p graf-after--p"&gt;This was just a setup tutorial, if you want to learn more about react navigation you can find the full documentation &lt;a href="https://reactnavigation.org/docs/getting-started" class="markup--anchor markup--p-anchor" rel="noopener"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;here&lt;/strong&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p id="6e00" class="graf graf--p graf-after--p"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;MTA Team:&lt;/strong&gt;&lt;/p&gt;
&lt;p id="9e62" class="graf graf--p graf-after--p"&gt;&lt;a href="https://medium.com/u/780987e259b0?source=post_page-----6e15f3fbf9e1----------------------" class="markup--anchor markup--p-anchor" rel="noopener"&gt;Ali Gümüş Tosun&lt;/a&gt; -&lt;a href="https://medium.com/u/f07974fc764c?source=post_page-----6e15f3fbf9e1----------------------" class="markup--anchor markup--p-anchor" rel="noopener"&gt; Semih Sevincli&lt;/a&gt; -&lt;a href="https://medium.com/u/fca2225fd420?source=post_page-----6e15f3fbf9e1----------------------" class="markup--anchor markup--p-anchor" rel="noopener"&gt; Aslancan Yılmaz&lt;/a&gt; - &lt;a href="https://medium.com/u/e86295cf2fe8?source=post_page-----6e15f3fbf9e1----------------------" class="markup--anchor markup--p-anchor" rel="noopener"&gt;Burak Arıcı&lt;/a&gt;&lt;/p&gt;
&lt;p id="0a74" class="graf graf--p graf-after--p"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;LinkedIn Accounts:&lt;/strong&gt;&lt;/p&gt;
&lt;p id="6b9c" class="graf graf--p graf-after--p graf--trailing"&gt;&lt;a href="https://www.linkedin.com/in/ali-g%C3%BCm%C3%BC%C5%9F-tosun-9a6736129/" class="markup--anchor markup--p-anchor" rel="noopener nofollow noopener"&gt;Ali Gümüş Tosun&lt;/a&gt; - &lt;a href="https://www.linkedin.com/in/semih-sevin%C3%A7li-02a0a4ba/" class="markup--anchor markup--p-anchor" rel="noopener nofollow noopener"&gt;Semih Sevinçli&lt;/a&gt; - &lt;a href="https://www.linkedin.com/in/aslancan-y%C4%B1lmaz-002965131/" class="markup--anchor markup--p-anchor" rel="noopener nofollow noopener"&gt;Aslancan Yılmaz&lt;/a&gt; - &lt;a href="https://www.linkedin.com/in/mustafa-burak-ar%C4%B1c%C4%B1-40889618b/" class="markup--anchor markup--p-anchor" rel="noopener nofollow noopener"&gt;Burak Arıcı&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;By &lt;a href="https://medium.com/@MtaTeam" class="p-author h-card"&gt;MTA Team&lt;/a&gt; on &lt;a href="https://medium.com/p/d4c057e2a13b"&gt;&lt;time class="dt-published"&gt;June 28, 2020&lt;/time&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://medium.com/@MtaTeam/setting-up-navigation-for-react-native-app-d4c057e2a13b" class="p-canonical"&gt;Canonical link&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Exported from &lt;a href="https://medium.com"&gt;Medium&lt;/a&gt; on June 28, 2020.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Setting Up Android Environment for Your First React Native Project</title>
      <dc:creator>MTA Team</dc:creator>
      <pubDate>Tue, 23 Jun 2020 15:43:34 +0000</pubDate>
      <link>https://forem.com/mtateam1/setting-up-android-environment-for-your-first-react-native-project-4mhf</link>
      <guid>https://forem.com/mtateam1/setting-up-android-environment-for-your-first-react-native-project-4mhf</guid>
      <description>
&lt;h3 id="b1d9" class="graf graf--h3 graf-after--figure"&gt;If you are interested in developing mobile apps with React Native but have no experience, this guide will let you start.&lt;/h3&gt;
&lt;h3 id="5dde" class="graf graf--h3 graf-after--h3"&gt;Prerequisites :&lt;/h3&gt;
&lt;blockquote id="5191" class="graf graf--blockquote graf-after--h3"&gt;Android Studio :&lt;/blockquote&gt;
&lt;p id="98f5" class="graf graf--p graf-after--blockquote"&gt;Just download and install android studio from the link below.&lt;/p&gt;
&lt;p id="33a3" class="graf graf--p graf-after--p"&gt;&lt;a href="https://developer.android.com/studio" class="markup--anchor markup--p-anchor" rel="noopener"&gt;&lt;/a&gt;&lt;a href="https://developer.android.com/studio"&gt;https://developer.android.com/studio&lt;/a&gt;&lt;/p&gt;
&lt;blockquote id="9e8d" class="graf graf--blockquote graf-after--p"&gt;JAVA SE Development Kit:&lt;/blockquote&gt;
&lt;p id="bccd" class="graf graf--p graf-after--blockquote"&gt;Again, download and install jdk that matches your system from the link below.&lt;/p&gt;
&lt;a href="https://www.oracle.com/java/technologies/javase-jdk13-downloads.html" class="markup--anchor markup--mixtapeEmbed-anchor" title="https://www.oracle.com/java/technologies/javase-jdk13-downloads.html"&gt;&lt;strong class="markup--strong markup--mixtapeEmbed-strong"&gt;Java SE 13 - Downloads&lt;/strong&gt;&lt;br&gt;&lt;em class="markup--em markup--mixtapeEmbed-em"&gt;&lt;/em&gt;&lt;/a&gt;&lt;a href="https://www.oracle.com/java/technologies/javase-jdk13-downloads.html" class="js-mixtapeImage mixtapeImage mixtapeImage--empty u-ignoreBlock"&gt;&lt;/a&gt;&lt;blockquote id="0fbc" class="graf graf--blockquote graf-after--mixtapeEmbed"&gt;Adding Environment Variables&lt;/blockquote&gt;
&lt;p id="83e9" class="graf graf--p graf-after--blockquote"&gt;After you installed jdk add “&lt;strong class="markup--strong markup--p-strong"&gt;C:\Program Files\Java\jdk-13.0.2\bin&lt;/strong&gt;” at the end of your “&lt;strong class="markup--strong markup--p-strong"&gt;Path&lt;/strong&gt;” variable in environment variables.&lt;/p&gt;
&lt;p id="9848" class="graf graf--p graf-after--p"&gt;Create another variable in environment variables named “&lt;strong class="markup--strong markup--p-strong"&gt;JAVA_HOME&lt;/strong&gt;” with the path “&lt;strong class="markup--strong markup--p-strong"&gt;C:\Program Files\Java\jdk-13.0.2&lt;/strong&gt;”&lt;/p&gt;
&lt;p id="494f" class="graf graf--p graf-after--p"&gt;Your address may differ depending on your installed JDK version.&lt;/p&gt;
&lt;p id="d978" class="graf graf--p graf-after--p"&gt;Check if path variables contain this folder and if not, add following with your username.&lt;/p&gt;
&lt;p id="aae0" class="graf graf--p graf-after--p"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;C:\Users\Your_Username\AppData\Local\Android\Sdk\platform-tools&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote id="6230" class="graf graf--blockquote graf-after--p"&gt;Installing React Native&lt;/blockquote&gt;
&lt;p id="c278" class="graf graf--p graf-after--blockquote"&gt;Install react-native with the command below&lt;/p&gt;
&lt;pre id="ad73" class="graf graf--pre graf-after--p"&gt;&lt;strong class="markup--strong markup--pre-strong"&gt;npm i -g react-native&lt;/strong&gt;&lt;/pre&gt;
&lt;blockquote id="625b" class="graf graf--blockquote graf-after--pre"&gt;Creating React Native Project&lt;/blockquote&gt;
&lt;p id="0319" class="graf graf--p graf-after--blockquote"&gt;Go to the directory you want to create project in and create project with the command below&lt;/p&gt;
&lt;pre id="2d46" class="graf graf--pre graf-after--p"&gt;&lt;strong class="markup--strong markup--pre-strong"&gt;react-native init Example&lt;/strong&gt;&lt;/pre&gt;
&lt;p id="8e3f" class="graf graf--p graf-after--pre"&gt;When we type &lt;strong class="markup--strong markup--p-strong"&gt;react-native init Example&lt;/strong&gt; to command line it will create a folder named &lt;strong class="markup--strong markup--p-strong"&gt;Example &lt;/strong&gt;and create the project inside it. Open your project after it is created.&lt;/p&gt;
&lt;p id="22d4" class="graf graf--p graf-after--p"&gt;— — — — — — — — — — — — — — — — — — — — — — — — — — — — — — —&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--kEe5GXZs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/600/0%2AxCyzzKxLtmNdc4rH"&gt;&lt;p id="44fc" class="graf graf--p graf-after--figure"&gt;This is our folder structure. &lt;strong class="markup--strong markup--p-strong"&gt;App.js&lt;/strong&gt; is our initial rendered file. So we are going to start from there.&lt;/p&gt;
&lt;blockquote id="a798" class="graf graf--blockquote graf-after--p"&gt;Building Project in Android Studio&lt;/blockquote&gt;
&lt;p id="2afd" class="graf graf--p graf-after--blockquote"&gt;Before we try to run our application in our emulator, we need our npm modules and javascript code to be built so android can run it.&lt;/p&gt;
&lt;p id="d65d" class="graf graf--p graf-after--p"&gt;Open android studio and select the android folder in your project, open it.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--czNSXXf_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2Aqcj9LpSOkQkL-neB"&gt;Click make project button or press Ctrl + F9&lt;p id="c03e" class="graf graf--p graf-after--figure"&gt;If you don’t want to use emulator but your android phone,you can follow our article about connecting over usb debugging with cable or wifi without cable &lt;a href="https://medium.com/p/4a065e4bc255" class="markup--anchor markup--p-anchor"&gt;here.&lt;/a&gt;&lt;/p&gt;
&lt;blockquote id="b5e3" class="graf graf--blockquote graf-after--p"&gt;Creating Virtual Device&lt;/blockquote&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--9sanAT58--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2A3IEAFtd2cQjtoAqf"&gt;Click tools from the menu in android studio and click AVD Manager&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--DpluihQ0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2Ala7wcKKR42sCD5zk"&gt;Click create virtual device button&lt;p id="6b55" class="graf graf--p graf-after--figure"&gt;Pick any device and click next&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--1glUcw9z--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2AA2q8rPHdTboesClc"&gt;Download any image then click next.&lt;p id="ace8" class="graf graf--p graf-after--figure"&gt;You can create device with the default configurations by clicking finish.&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--3J50vg8X--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2AD6F2xDmUGK4eDP2E"&gt;You can start your virtual device by pressing the first icon.&lt;p id="9f66" class="graf graf--p graf-after--figure"&gt;Open your project directory in terminal and run this command&lt;/p&gt;
&lt;pre id="3513" class="graf graf--pre graf-after--p"&gt;react-native run-android&lt;/pre&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--UMX1TbO3--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2AIzaVcj9hbbqc0U9j"&gt;&lt;p id="7340" class="graf graf--p graf-after--figure"&gt;If you get any of these errors change directory into android and run clean command&lt;/p&gt;
&lt;pre id="3d08" class="graf graf--pre graf-after--p"&gt;cd android&lt;br&gt;./gradlew clean&lt;/pre&gt;
&lt;p id="8872" class="graf graf--p graf-after--pre"&gt;&lt;em class="markup--em markup--p-em"&gt;If you run this command in android studio terminal, just run&lt;/em&gt;&lt;/p&gt;
&lt;pre id="28d8" class="graf graf--pre graf-after--p"&gt;gradlew clean&lt;/pre&gt;
&lt;p id="80a3" class="graf graf--p graf-after--pre"&gt;&lt;em class="markup--em markup--p-em"&gt;After cleaning project if you still get these errors, just re run the &lt;/em&gt;&lt;strong class="markup--strong markup--p-strong"&gt;&lt;em class="markup--em markup--p-em"&gt;react-native run-android &lt;/em&gt;&lt;/strong&gt;&lt;em class="markup--em markup--p-em"&gt;command and it will work eventually.&lt;/em&gt;&lt;/p&gt;
&lt;p id="8758" class="graf graf--p graf-after--p"&gt;&lt;em class="markup--em markup--p-em"&gt;* Task :app:packageDebug FAILED&lt;/em&gt;&lt;/p&gt;
&lt;p id="7935" class="graf graf--p graf-after--p"&gt;&lt;em class="markup--em markup--p-em"&gt;java.io.IOException: Unable to delete directory ……&lt;/em&gt;&lt;/p&gt;
&lt;p id="2b64" class="graf graf--p graf-after--p"&gt;&lt;em class="markup--em markup--p-em"&gt;* What went wrong:&lt;/em&gt;&lt;/p&gt;
&lt;p id="2a1c" class="graf graf--p graf-after--p"&gt;&lt;em class="markup--em markup--p-em"&gt;Execution failed for task ‘:app:compileDebugJavaWithJavac’&lt;/em&gt;&lt;/p&gt;
&lt;img class="graf-image" src="https://res.cloudinary.com/practicaldev/image/fetch/s--jp7JdNJu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://cdn-images-1.medium.com/max/800/0%2AvEgAclSUPveWRZF6"&gt;Our app started.&lt;p id="06fa" class="graf graf--p graf-after--figure"&gt;Thank you for reading. You can follow us to learn more about react &amp;amp; react native development.&lt;/p&gt;
&lt;p id="a609" class="graf graf--p graf-after--p"&gt;Feel free to ask anything about this article if you get any errors. You can contact any of us on linkedin.&lt;/p&gt;
&lt;h4 id="288a" class="graf graf--h4 graf-after--p"&gt;MTA Team:&lt;/h4&gt;
&lt;p id="9176" class="graf graf--p graf-after--h4"&gt;&lt;a href="https://medium.com/u/780987e259b0" class="markup--user markup--p-user"&gt;Ali Gümüş Tosun&lt;/a&gt; - &lt;a href="https://medium.com/u/f07974fc764c" class="markup--user markup--p-user"&gt;Semih Sevincli&lt;/a&gt; - &lt;a href="https://medium.com/u/fca2225fd420" class="markup--user markup--p-user"&gt;Aslancan Yılmaz&lt;/a&gt; - &lt;a href="https://medium.com/u/e86295cf2fe8" class="markup--user markup--p-user"&gt;Burak Arıcı&lt;/a&gt;&lt;/p&gt;
&lt;p id="8945" class="graf graf--p graf-after--p"&gt;&lt;strong class="markup--strong markup--p-strong"&gt;LinkedIn Accounts:&lt;/strong&gt;&lt;/p&gt;
&lt;p id="6a58" class="graf graf--p graf-after--p graf--trailing"&gt;&lt;a href="https://www.linkedin.com/in/ali-g%C3%BCm%C3%BC%C5%9F-tosun-9a6736129/" class="markup--anchor markup--p-anchor" rel="noopener"&gt;Ali Gümüş Tosun&lt;/a&gt; - &lt;a href="https://www.linkedin.com/in/semih-sevin%C3%A7li-02a0a4ba/" class="markup--anchor markup--p-anchor" rel="noopener"&gt;Semih Sevinçli&lt;/a&gt; - &lt;a href="https://www.linkedin.com/in/aslancan-y%C4%B1lmaz-002965131/" class="markup--anchor markup--p-anchor" rel="noopener"&gt;Aslancan Yılmaz&lt;/a&gt; - &lt;a href="https://www.linkedin.com/in/mustafa-burak-ar%C4%B1c%C4%B1-40889618b/" class="markup--anchor markup--p-anchor" rel="noopener"&gt;Burak Arıcı&lt;/a&gt;&lt;/p&gt;


&lt;p&gt;By &lt;a href="https://medium.com/@MtaTeam" class="p-author h-card"&gt;MTA Team&lt;/a&gt; on &lt;a href="https://medium.com/p/6e15f3fbf9e1"&gt;&lt;time class="dt-published"&gt;June 22, 2020&lt;/time&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://medium.com/@MtaTeam/setting-up-android-environment-for-your-first-react-native-project-6e15f3fbf9e1" class="p-canonical"&gt;Canonical link&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Exported from &lt;a href="https://medium.com"&gt;Medium&lt;/a&gt; on June 23, 2020.&lt;/p&gt;

</description>
      <category>reactnative</category>
      <category>react</category>
      <category>android</category>
    </item>
  </channel>
</rss>
