title: How do I pass props from top navigation to screen within a nested navigation in react navigation 5
body: <p>I have a case where I have a nested navigator setting.
  The app.js holds the loggedIn state and the navigators start as The startnav gets called in app.js passing loggedIn state: </p>
  
  <pre><code>    class StartupNav extends Component {
    constructor(props) {
      super(props);
      console.log(props.loggedIn);
    }
  
    render() {
      return (
        &lt;NavigationContainer independent={true}&gt;
          &lt;Stack.Navigator&gt;
            {this.props.loggedIn ? (
              &lt;&gt;
                &lt;Stack.Screen name="MainContainer" component={MainContainer} /&gt;
              &lt;/&gt;
            ) : (
              &lt;Stack.Screen
                name="AuthStack"
                component={AuthStack}
                params="that" //props pass attempt which isnt successful
              /&gt;
            )}
          &lt;/Stack.Navigator&gt;
        &lt;/NavigationContainer&gt;
      );
    }
  }
  
  export default StartupNav;
  </code></pre>
  
  <p>The authStack holds the login part as :</p>
  
  <pre><code>   class AuthStack extends Component {
    constructor(props) {
      super(props);
      console.log('props from authstack', props);
    }
    render() {
      return (
        &lt;NavigationContainer independent={true}&gt;
          &lt;Stack.Navigator&gt;
            &lt;Stack.Screen name="Login" component={Login} /&gt;
            &lt;Stack.Screen name="ForgotPassword" component={ForgotPassword} /&gt;
          &lt;/Stack.Navigator&gt;
        &lt;/NavigationContainer&gt;
      );
    }
  }
  </code></pre>
  
  <p>Then theres the login screen where I do the login logic and make an attempt to set the state in app.js loggedIn=true. After login is Successful I need to open the MainContainer which contains the loggedin app screens.</p>
  
  <p>I am unable to pass props from the upper level navScreen to the lowers so that I could call prop function when login is successful. I tried as commented in the code like we normally do but this wasnt even valid.
  Can anybody shed a light on this, or point me to the right direction.</p>
  
  <p>I'm using react navigation 5.</p>