title: Delay in keyboard dismiss react-native
body: <p>I am building a react native app and I am fairly new to this. I am using <a href="https://github.com/react-community/react-navigation" rel="nofollow noreferrer">React navigation</a> for moving from one page to another. Currently, I am using stack navigator.</p>
  
  <p>I have two screens, A and B. In screen B I have a search input that uses the keyboard. When the back button in the header is pressed whilst the keyboard is open I navigate to screen A but there is a significant delay before the keyboard dismisses. I have put Keyboard.dismiss(); in componentWillUnmount in Screen B and componentWillMount in screen A. Unsure as to how or wether or not it's possible to add an onClick event to the back button as I believe it's inside the header component.</p>
  
  <pre><code>  export default class Locations extends Component {
     static navigationOptions = {
       title: 'Search Location',
     } 
  
    renderHeader = () =&gt; {
      return &lt;SearchBar onChangeText={(text) =&gt;this.handleSearch(text)} 
        placeholder="Type Here..." lightTheme round /&gt;;
    }
    componentWillUnmount(){
      Keyboard.dismiss();
    }
  </code></pre>
  
  <p>Any one had this issue before?</p>