title: TypeError: undefined is not an object (evaluating '_route$params.lat')
body: <p>I have react native app which I have two screens so in first screen the user will navigate to another screen where will get three values and in button clicked I am passing this values to the first screen again, in the second screen I am Passing parameters using something like this:</p>
  <p><code>&lt;TouchableOpacity style={styles.touch} onPress={() =&gt; this.props.navigation.navigate(&quot;dashboard&quot;, { lat: this.state.latitude, long:this.state.longitude,  alt: this.state.altitude})}&gt;</code></p>
  <p>However I am getting this error <code>TypeError: undefined is not an object (evaluating '_route$params.lat')</code> in first screen which I understand that these values are null coz I have to navigate to the second screen and when navigate from second screen to first will pass these values. how I can fix that?</p>
  <p>I have followed the <a href="https://reactnavigation.org/docs/params" rel="nofollow noreferrer">documentation</a> step by step also i did the following in first screen</p>
  <pre><code>const app = ({ route, navigation }) =&gt; {
      const { lat } = route.params;
      const { long } = route.params;
      const { alt } = route.params;
  </code></pre>
  <p>note that the second screen is class components and first screen is function components
  and the following is the stuck</p>
  <pre><code>    &lt;RootStack.Navigator&gt;
                 //this first screen
                  &lt;RootStack.Screen
                      name=&quot;dashboard&quot;
                      component={app}
                      options={{ headerShown: false }}
                  /&gt;
  //second screen
                  &lt;RootStack.Screen
                      name=&quot;location&quot;
                      component={location}
                      options={{
      
                          title: 'Verify your location',
                      }}
                  /&gt;
              &lt;/RootStack.Navigator&gt;
  </code></pre>