title: How to get a height of a Keyboard in React-Native?
body: <p>I am using React-Navigation in my app and the app consists of StackNavigator with multiple screens, some screens of which have TextInput with <code>autoFocus={true}</code></p>
  
  <p><strong>Problem:</strong> on these screens when the component renders, the height of the screen is being set in the constructor:</p>
  
  <pre><code>constructor(props) {
      super(props);
      this.state = { 
          height: Dimensions.get('window').height,
      };
  }
  </code></pre>
  
  <p>But, since the <code>autoFocus</code> of TextInput is <code>true</code>, the keyboard on this screen pops-up on the screen almost instantly <strong>after the render</strong>, causing the component to re-render due to the eventListener that is added to Keyboard in componentWillMount:</p>
  
  <pre><code> componentWillMount() {
      this.keyboardWillShowListener = Keyboard.addListener(
          "keyboardWillShow",
          this.keyboardWillShow.bind(this)
      );
  }
  
  keyboardWillShow(e) {
      this.setState({
          height:
              Dimensions.get("window").height * 0.9 - e.endCoordinates.height
      });
      LayoutAnimation.configureNext(LayoutAnimation.Presets.easeInEaseOut);
  }
  </code></pre>
  
  <p>This affects the performance and I would like to avoid the unnecessary re-renders. </p>
  
  <p><strong>Questions:</strong><br>
  1. Is it possible to set the dynamic height (depending on the device) of the Keyboard in React-Navigation's ScreenProps?<br>
  2. Is it possible to do the same with React-Navigation's state.params?<br>
  3. Is there any other way to solve this problem, apart from applying KeyboardAvoidingView or <a href="https://github.com/APSL/react-native-keyboard-aware-scroll-view" rel="noreferrer">this module</a> ?</p>