title: React Native - BackHandler is not working when keyboard is in opening state
body: <p>I need to close a view using setState while closing the keyboard. Using the onBlur event in TextInput, it is working fine. But In android on pressing the hardware back button also keyboard is closing. But onBlur event has not been called. TextInput still focused, but the keyboard closed. 
  For backhander, I am using the following code,</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>componentWillMount() {
      BackHandler.addEventListener('hardwareBackPress', this.handleBackPress);
  }
  
  handleBackPress = () =&gt; {
      console.log("HANDLE BACK PRESSS")
      return true;
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>Also I tried the following - Keyboard.addListener</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>componentWillMount () {
      this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this._keyboardDidShow);
      this.keyboardDidHideListener = Keyboard.addListener('keyboardDidHide', this._keyboardDidHide);
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>componentWillUnmount() {
      this.keyboardDidShowListener.remove();
      this.keyboardDidHideListener.remove();
  }
  
  _keyboardDidShow() {
      alert('Keyboard Shown');
    }
  
  _keyboardDidHide = () =&gt; {
      alert('Keyboard Hidden');
  }</code></pre>
  </div>
  </div>
  </p>
  
  <p>But no use. These things are not triggering when the keyboard is in an open state. After the keyboard closed, everything is working as expected.</p>
  
  <p>Suggest some way to get the trigger when pressing the back button while keyboard is in open state.</p>