title: How to call function on 'Enter' press in TextInput - React Native
body: <p>I am trying to make Search Bar. I want user to type something in <code>TextInput</code> and when user press 'Enter' I want to call my function.</p>
  <pre><code>&lt;TextInput
  //here when user press enter call function()
  style={styles.searchStyle}
  allowFontScaling={false}
  placeholder=&quot;Search&quot; 
  onChangeText={(val) =&gt; {setSearch(val)}}
  /&gt; 
  </code></pre>
  <p>I tried <code>onSubmitEditing</code> but it doesn't work.</p>