title: can't pass parameters react native 5.x
body: <p>i don't know why but the program stats.js can't read the parameter passed by SearchScreen.js
  Can anyone help me?</p>
  <p><strong>SearchScreen.js</strong></p>
  <pre><code>const SearchScreen =({navigation}) =&gt; {
  const [name, SetName] = React.useState();
      return (
          &lt;View style={styles.container}&gt;
          &lt;TextInput
                      style={styles.inputText}
                      placeholder=&quot;Name of the restaurant...&quot;
                      placeholderTextColor=&quot;#003f5c&quot;
                      onChangeText={text =&gt; SetName(text)}
                      //onSubmitEditing={ () =&gt; this.state.navigate('InsertEmailAddress', name)}
                      /&gt;
                      &lt;Text&gt; {name} &lt;/Text&gt;
                      &lt;TouchableOpacity
                     onPress={() =&gt; {navigation.setParams(name), navigation.navigate('Stats', name)}}&gt;
                    &lt;Text &gt;continue&lt;/Text&gt;
                  &lt;/TouchableOpacity&gt;
          &lt;/View&gt;
      );
  };
  </code></pre>
  <p><strong>Stats.js</strong></p>
  <pre><code>const StatsScreen = ({route, navigation}) =&gt; {
      return (
          &lt;View style={styles.container}&gt;
              &lt;Text&gt; Stats Screen &lt;/Text&gt;
                &lt;Text&gt;{route.params}&lt;/Text&gt;
          &lt;/View&gt;
      );
  };
  
  </code></pre>