title: Moving values from one screen to another ERROR: undefined is not an object (evaluating 'route.params.message')
body: <p>I am trying to navigate from one screen to another in react native by carrying a value from one screen to the other however, i am getting the above error.  Ideally i would like send the value from within a flatlist, i am trying to achieve a clickable flatlist which carrys a parameter from the selected row to the other screen.</p>
  
  <p>//index.js</p>
  
  <pre><code>import React from 'react';
  import { StyleSheet, Button, Text, View, FlatList, TouchableHighlight } from 'react-native';
  
  const ComponentsScreen = ({ navigation }) =&gt; {
  
    //example for detail scree
    return (
      &lt;View&gt;
      &lt;FlatList
             data={[
               { key: 'Task 1' },
               { key: 'Task 2' },
               { key: 'Task 3' },
               { key: 'Task 4' },
               { key: 'Task 5' },
             ]}
             renderItem={({ item }) =&gt; {
                 return (
                   &lt;TouchableHighlight
                          onPress={() =&gt;
                          navigation.navigate('Next', { message: 'hello from screen 1' })}
                   &gt;
                        &lt;Text &gt;{item.key}&lt;/Text&gt;
                   &lt;/TouchableHighlight&gt;
                 );
               }
             }
  
      /&gt;
  
      &lt;Button
          onPress={() =&gt; navigation.navigate('NextScreen')}
          title="Go to ImageScreen"
      /&gt;
      &lt;/View&gt;
    );
  };
  const styles = StyleSheet.create({
  textStyle: {
    fontSize: 30
  }
  });
  
  export default ComponentsScreen;
  </code></pre>
  
  <p>//NextScreen.js</p>
  
  <pre><code>  import React from 'react';
  import { Text, View } from 'react-native';
  
  //example for detail screen
  const NextScreen = (route) =&gt; {
  const { message } = route.params;
  
      return (
          &lt;View&gt;
            &lt;Text&gt;message: {JSON.stringify(message)}&lt;/Text&gt;
          &lt;/View&gt;
      );
  };
  
  export default NextScreen;
  </code></pre>
  
  <p>app.js</p>
  
  <pre><code>import React, { Component } from 'react';
  import { createAppContainer } from 'react-navigation';
  import { createStackNavigator } from 'react-navigation-stack';
  import Index from './screens/Index';
  import NextScreen from './screens/NextScreen';
  
  
  const navigator = createStackNavigator({
    Home: Index,
    Next: NextScreen
  },
  {
    initialRouteName: 'Home',
    defaultNavigationOptions: {
      title: 'App'
    }
  }
  );
  
  export default createAppContainer(navigator);
  </code></pre>