<?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: anjushaKhandavalli</title>
    <description>The latest articles on Forem by anjushaKhandavalli (@anjushakhandavalli).</description>
    <link>https://forem.com/anjushakhandavalli</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%2F437226%2F4bd86f1e-5d32-48f2-b7fe-60058f1fd0dc.jpg</url>
      <title>Forem: anjushaKhandavalli</title>
      <link>https://forem.com/anjushakhandavalli</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/anjushakhandavalli"/>
    <language>en</language>
    <item>
      <title>Auto setup remote branch with push.autoSetupRemote</title>
      <dc:creator>anjushaKhandavalli</dc:creator>
      <pubDate>Wed, 21 Dec 2022 04:28:19 +0000</pubDate>
      <link>https://forem.com/anjushakhandavalli/auto-setup-remote-branch-with-pushautosetupremote-o98</link>
      <guid>https://forem.com/anjushakhandavalli/auto-setup-remote-branch-with-pushautosetupremote-o98</guid>
      <description>&lt;p&gt;Whenever you create a new branch and trying to push the new commit then you will start seeing this error:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--X3QqQ8En--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44zza3krqbxhzi9xgqck.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--X3QqQ8En--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/44zza3krqbxhzi9xgqck.png" alt="Error message while pushing the first commit to new branch&amp;lt;br&amp;gt;
" width="880" height="339"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;After this we often run:&lt;br&gt;
&lt;code&gt;git push — set-upstream origin &amp;lt;branch-name&amp;gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;To get rid of doing this every time, git from version 2.37.0 gave us a configuration field called “push.autoSetupRemote” . More about this on &lt;a href="https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushautoSetupRemote"&gt;git words&lt;/a&gt; :-)&lt;/p&gt;
&lt;h6&gt;
  
  
  push.autoSetupRemote
&lt;/h6&gt;

&lt;blockquote&gt;
&lt;p&gt;If set to “true” assume --set-upstream on default push when no upstream tracking exists for the current branch; this option takes effect with push.default options simple, upstream, and current. It is useful if by default you want new branches to be pushed to the default remote (like the behavior of push.default=current) and you also want the upstream tracking to be set. Workflows most likely to benefit from this option are simple central workflows where all branches are expected to have the same name on the remote.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;In simple words to push the current branch and set the remote as upstream automatically every time you push, setting push.autoSetupRemote to true in git config once, is enough.&lt;/p&gt;

&lt;p&gt;To do this just run this command in terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global --add --bool push.autoSetupRemote true

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then &lt;code&gt;git push&lt;/code&gt; will automatically setup the remote branch.&lt;/p&gt;

&lt;p&gt;Note: The &lt;code&gt;--global&lt;/code&gt; flag means this will apply to all git commands on your machine (regardless of which repo it is), you can omit the flag to make it specific to a single repo on your machine.&lt;/p&gt;

</description>
      <category>git</category>
    </item>
    <item>
      <title>Findings while upgrading React Navigation from 4.x to 5.x(Part-2)</title>
      <dc:creator>anjushaKhandavalli</dc:creator>
      <pubDate>Wed, 05 Aug 2020 10:52:53 +0000</pubDate>
      <link>https://forem.com/anjushakhandavalli/findings-while-upgrading-react-navigation-from-4-x-to-5-x-part-2-134n</link>
      <guid>https://forem.com/anjushakhandavalli/findings-while-upgrading-react-navigation-from-4-x-to-5-x-part-2-134n</guid>
      <description>&lt;p&gt;In &lt;a href="https://dev.to/anjushakhandavalli/findings-while-upgrading-react-navigation-from-4-x-to-5-x-part-1-41gk"&gt;Findings while upgrading React Navigation from 4.x to 5.x (Part-1)&lt;/a&gt; I explained a few findings our team had while upgrading React Navigation from 4.x to 5.x. In this part-2, I will share few more findings.&lt;/p&gt;

&lt;h2&gt;
  
  
  getParam:
&lt;/h2&gt;

&lt;p&gt;Till React navigation 4.x we have used the &lt;strong&gt;getParam&lt;/strong&gt; to set a fallback value of a param whenever the param is &lt;strong&gt;undefined&lt;/strong&gt;. For ex:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--nPf9wyPB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/s9xsog4fb3byhmaavlek.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--nPf9wyPB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/s9xsog4fb3byhmaavlek.png" alt="Alt Text" width="880" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If params is &lt;strong&gt;undefined&lt;/strong&gt; this fails. To get rid of this we used &lt;strong&gt;getParam&lt;/strong&gt; so that whenever the accessed param is &lt;strong&gt;undefined&lt;/strong&gt; it will fallback to the default value that we pass as part of the &lt;strong&gt;getParam&lt;/strong&gt; as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ubZkAMMs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6xqtw4nesjezrg6zs8fw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ubZkAMMs--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6xqtw4nesjezrg6zs8fw.png" alt="Alt Text" width="880" height="92"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;so now if name or params are &lt;strong&gt;undefined&lt;/strong&gt;, fallback sets the value to ram.&lt;/p&gt;

&lt;p&gt;But now in 5.x there is no &lt;strong&gt;getParam&lt;/strong&gt; to achieve this. Still we can achieve the same thing by using the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining"&gt;optional chaining&lt;/a&gt; and &lt;a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Nullish_coalescing_operator"&gt;null coalescing operators&lt;/a&gt; as:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--V5L6_rZJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3auzbj3srbdppxqewini.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--V5L6_rZJ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3auzbj3srbdppxqewini.png" alt="Alt Text" width="880" height="95"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Passing additional props to the screen:
&lt;/h2&gt;

&lt;p&gt;In React Navigation 5.x specifying the screen in navigator will be like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7AFQe3BH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ft4kjs01u7zyzsr6chkl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7AFQe3BH--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/ft4kjs01u7zyzsr6chkl.png" alt="Alt Text" width="880" height="204"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If we need to pass props to screens then inlining components as below is not preferred:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UeeyaXrQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7rtbplmeim3ndeeaxpfd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UeeyaXrQ--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/7rtbplmeim3ndeeaxpfd.png" alt="Alt Text" width="880" height="161"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is preferred:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Q052DOR8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/56i83hq6ukktpspxq0ft.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Q052DOR8--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/56i83hq6ukktpspxq0ft.png" alt="Alt Text" width="880" height="146"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tab bar visibility control:
&lt;/h2&gt;

&lt;p&gt;In version 4.x hiding the tab bar for specific screens can be achieved by setting &lt;strong&gt;tabBarVisible&lt;/strong&gt; prop to either true or false as part of the &lt;strong&gt;Options&lt;/strong&gt; for screens.&lt;/p&gt;

&lt;p&gt;But in version 5.x hiding tab bar using &lt;strong&gt;tabBarVisible&lt;/strong&gt; prop is not recommended as it is causing some glitches. So now this can be achieved by nesting the tab navigator inside the first screen of the stack instead of nesting stack inside tab navigator.&lt;/p&gt;

&lt;p&gt;For example let’s say we have &lt;strong&gt;Home&lt;/strong&gt;, &lt;strong&gt;Feed&lt;/strong&gt;, &lt;strong&gt;Notifications&lt;/strong&gt;, as three tabs and &lt;strong&gt;Profile&lt;/strong&gt; ,&lt;strong&gt;Settings&lt;/strong&gt; are the screens inside &lt;strong&gt;Home&lt;/strong&gt; tab. So for this the structure will look like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uAsru8y0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/r894l5c1p3zftfoi32dq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uAsru8y0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/r894l5c1p3zftfoi32dq.png" alt="Alt Text" width="880" height="561"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So now if you don’t want the tab bar to be visible for Profile and Settings screens then this can be achieved by nesting the tab navigator inside the first screen of the stack as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--m20eol4p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gvwhm7fa1hc9bzgixfy9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--m20eol4p--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gvwhm7fa1hc9bzgixfy9.png" alt="Alt Text" width="880" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Done now you won’t see tab bar for &lt;strong&gt;Profile&lt;/strong&gt; and &lt;strong&gt;Settings&lt;/strong&gt; without any usage of &lt;strong&gt;tabBarVisible&lt;/strong&gt; prop.&lt;/p&gt;

&lt;h2&gt;
  
  
  Nested navigation with initial route:
&lt;/h2&gt;

&lt;p&gt;By default, when you navigate a screen in the nested navigator, the specified screen is used as the initial screen and the initial route prop on the navigator is ignored. This behaviour is different from the React Navigation 4.&lt;/p&gt;

&lt;p&gt;If you need to render the initial route specified in the navigator, you can disable the behaviour of using the specified screen as the initial screen by setting &lt;strong&gt;initial: false&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--xxFUmRFS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lh9kkno9j1b10wb0vs6i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--xxFUmRFS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/lh9kkno9j1b10wb0vs6i.png" alt="Alt Text" width="880" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hope this article helps you to figure out some of the issues while upgrading from React Navigation v4.x to 5.x. Happy Upgrade!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Findings while upgrading React Navigation from 4.x to 5.x (Part-1)</title>
      <dc:creator>anjushaKhandavalli</dc:creator>
      <pubDate>Tue, 21 Jul 2020 17:41:47 +0000</pubDate>
      <link>https://forem.com/anjushakhandavalli/findings-while-upgrading-react-navigation-from-4-x-to-5-x-part-1-41gk</link>
      <guid>https://forem.com/anjushakhandavalli/findings-while-upgrading-react-navigation-from-4-x-to-5-x-part-1-41gk</guid>
      <description>&lt;p&gt;As part of refactoring and upgrading the code-base, our team decided to upgrade the React navigation version from 4.x to 5.x. Now this 5.x has completely new API, so the old code using React navigation 4.x will no longer work with this version. Moving the entire code-base navigation version to 5.x can be a lot of work.&lt;/p&gt;

&lt;p&gt;To achieve this we have used the &lt;a href="https://reactnavigation.org/docs/compatibility/"&gt;compat&lt;/a&gt; library, So that we can reuse code using the version 4.x with minimal changes. Then slowly started moving each navigator to the version 5.x. As part of this we started a round of testing to see if everything works fine but surprisingly we encountered few problems which are not described in official documents. So, we took a deep dive and see what causes the problem and here are a few findings:&lt;/p&gt;

&lt;h2&gt;
  
  
  navigation.state is undefined in v5:
&lt;/h2&gt;

&lt;p&gt;In React Navigation 4.x, the &lt;strong&gt;navigation&lt;/strong&gt; prop has various helper methods as well as the current screen's state.But In 5.x, the &lt;strong&gt;navigation&lt;/strong&gt; prop splitted into 2 props: &lt;strong&gt;navigation&lt;/strong&gt; and &lt;strong&gt;route&lt;/strong&gt;. &lt;strong&gt;navigation&lt;/strong&gt; prop contains helper methods such as &lt;strong&gt;navigate&lt;/strong&gt;, &lt;strong&gt;goBack&lt;/strong&gt; etc., and &lt;strong&gt;route&lt;/strong&gt; prop contains the current screen's data which we previously accessed via &lt;strong&gt;navigation.state&lt;/strong&gt;.&lt;/p&gt;

&lt;h4&gt;
  
  
  In version 4.x:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--f1Fe742t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/l6l47bu5v6s6c6nl0qjd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--f1Fe742t--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/l6l47bu5v6s6c6nl0qjd.png" alt="Alt Text" width="880" height="489"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  In version 5.x:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gA6pwjxU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/oa5kbpq6gw53rrit37b1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gA6pwjxU--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/oa5kbpq6gw53rrit37b1.png" alt="Alt Text" width="880" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Header null not allowed:
&lt;/h2&gt;

&lt;p&gt;Header is a React Element or a function which is part of the &lt;strong&gt;navigationOptions&lt;/strong&gt; that is used to configure the header (Also known as navigation header i.e the rectangle at the top of the screen). If you want the header to be null&lt;/p&gt;

&lt;p&gt;In version 4.x we can specify it as:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UZpfjRRd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/g85u0osgz7mrclbylma5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UZpfjRRd--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/g85u0osgz7mrclbylma5.png" alt="Alt Text" width="880" height="99"&gt;&lt;/a&gt;&lt;br&gt;
But in version 5.x If we specify it as null causing crashes. So In 5.x it should be a function that returns an empty component:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--uKIGcCvW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/aw4ggis0rfnw8r4itwyc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--uKIGcCvW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/aw4ggis0rfnw8r4itwyc.png" alt="Alt Text" width="880" height="96"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  navigationOptions -headerLeft, headerRight, headerTitle should be function:
&lt;/h2&gt;

&lt;p&gt;In React Navigation 4.x these navigationOptions can be a element as follows:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yBSHXTOb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pasbdsv3k2mir64442ra.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yBSHXTOb--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/pasbdsv3k2mir64442ra.png" alt="Alt Text" width="880" height="109"&gt;&lt;/a&gt;&lt;br&gt;
But in 5.x if we are specifying any of these navigationOptions as a element then they are causing the crashes. So we finally fixed this problem by specifying these navigationOptions as a function that returns a React element as follows:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dx6vRyF4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gwee9siui697ojx5vtdq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dx6vRyF4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gwee9siui697ojx5vtdq.png" alt="Alt Text" width="880" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Finding routeName in v5:
&lt;/h2&gt;

&lt;p&gt;In React Navigation 4.x routeName is part of the &lt;strong&gt;navigation&lt;/strong&gt; prop and that can be accessed as:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--n8OoLEpy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1mm5c0vv46us4gvma3hz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--n8OoLEpy--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/1mm5c0vv46us4gvma3hz.png" alt="Alt Text" width="880" height="216"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But in 5.x routeName is now part of the route prop and that is renamed to name which can be accessed as:&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--wfFOjjGp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5jxas592w4adfbw0nppr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--wfFOjjGp--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5jxas592w4adfbw0nppr.png" alt="Alt Text" width="880" height="203"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Navigating to a screen in a nested navigator:
&lt;/h2&gt;

&lt;p&gt;The difference is that in the previous versions, all configuration was static, so React Navigation could statically find the list of all the navigators and their screens by recursing into nested configurations. But with dynamic configuration, React Navigation doesn’t know which screens are available and where until the navigator containing the screen renders. Normally, a screen doesn’t render its contents until you navigate to it, so the configuration of navigators which haven’t rendered is not yet available. This makes it necessary to specify the hierarchy you’re navigating to. This is also why you should have as little nesting of navigators as possible to keep your code simpler.&lt;/p&gt;

&lt;p&gt;In 4.x all the navigation configurations were static. So React navigation can find the specified screen by recursing the list of all navigators and their screens in nested configurations.&lt;/p&gt;

&lt;p&gt;For example lets take the following in which SettingsNavigator is nested inside ProfileNavigator ( To show how nested navigation works I am using the navigator configuration in 4.x version)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FP46zB6M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fpc394in0ntcb4hqmi4i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FP46zB6M--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/fpc394in0ntcb4hqmi4i.png" alt="Alt Text" width="880" height="695"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;So, to navigate to the EditProfileScreen in 4.x navigate will look like :&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--EdTast99--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gt1c6fw3tg3dcwlx4crm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--EdTast99--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/gt1c6fw3tg3dcwlx4crm.png" alt="Alt Text" width="880" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;But with dynamic configuration in 5.x, React navigation doesn’t know which screens are available and where until the navigator containing the screen renders. Normally a screen doesn’t render its contents until you navigate to it, so the configuration of navigators which haven’t rendered is not yet available. This makes it necessary to specify the hierarchy you’re navigating to. So to navigate to the EditProfileScreen we have to do as follows:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--huP1sTs0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wjoxbhiejv7vn4251qks.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--huP1sTs0--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/wjoxbhiejv7vn4251qks.png" alt="Alt Text" width="880" height="106"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;These are the few findings that our team has while upgrading React Navigation from 4.x to 5.x and which are not described much in documentation. I will continue to add few more findings in part-2. Thanks for reading.&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>react</category>
      <category>reactnative</category>
      <category>typescript</category>
    </item>
  </channel>
</rss>
