title: Passing Params from Stack-navigator to tab Navigator (react-navigation 5)
body: <p>I am trying to pass the user ID from the login screen to the home screen which is part of a nested tab navigator.
  here is how my app is structured: </p>
  
  <pre><code> const mainStack = () =&gt;(
  
               &lt;Tab.Navigator
  
  
               tabBarOptions={{
                activeTintColor: 'tomato',
                inactiveTintColor: 'gray',
              }}
               &gt;
                  &lt;Tab.Screen name="Home" component={Homescreen} 
                   options = {{headerStyle: {backgroundColor: 'yellow'}}}
                  /&gt;
                  &lt;Tab.Screen name="Profile" component={otherStack} /&gt;
               &lt;/Tab.Navigator&gt;
  
      )
  
  
  
  
  export default () =&gt; (
  
          &lt;NavigationContainer &gt;
                &lt;Stack.Navigator screenOptions={{
                    headerShown: false
                    }}&gt;
                  &lt;Stack.Screen name='Welcome' component={WelcomeScreen} /&gt;
                  &lt;Stack.Screen name = 'Register' component = {RegisterScreen} /&gt;
                  &lt;Stack.Screen name= 'Login' component={LoginScreen} /&gt;
                  &lt;Stack.Screen name = 'mainStack' component={mainStack} /&gt;
                &lt;/Stack.Navigator&gt;
  
  
  
          &lt;/NavigationContainer&gt;
  
  )
  </code></pre>
  
  <p>Whenever I go from the login screen to Home and call this.props.navigation.getParam('id') I get an error saying that it is not a function. After closer inspection I see that this.props.navigation.state is undefined. Probably meaning that my params aren't passed to the Home screen even though I don't have any issues navigating to it. </p>
  
  <p>I tried using NavigationActions but I get an error that I don't see mentioned anywhere else. </p>
  
  <p>I navigate to Home like this:</p>
  
  <pre><code>this.props.navigation.navigate('Home' { id: 'myId' })
  </code></pre>
  
  <p>I also tried this syntax:</p>
  
  <pre><code> navigation.navigate('Root', {
    screen: 'Settings',
    params: { user: 'jane' },
  });
  </code></pre>
  
  <p>but I get the same error</p>
  
  <p>It is also worth noting that I used React.component rather than making my screens into functions. I am not sure if that causes any issues because in the tutorial for react-navigation v5 I saw the guy use functions instead of react components. </p>
  
  <p>any help will be very much appreciated!!</p>