title: React Native dynamic webview height
body: <p>I have WebView content are which changes it's height depending on amount of content. 
  So I found a way how to take the height of the content through the document.title attribute onNavigationStateChange.
  Looks like this:</p>
  
  <pre><code>let html = '&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;body&gt;&lt;script&gt;document.title = document.height;&lt;/script&gt;&lt;/body&gt;&lt;/html&gt;';
  </code></pre>
  
  <p>And on onNavigationStateChange</p>
  
  <pre><code>onNavigationStateChange(navState) {
    this.setState({
      height: navState.title
    });
    console.log("DATA");
    console.log(this.state.height)
  }
  </code></pre>
  
  <p>On the actual WebView render I do:</p>
  
  <pre><code>&lt;WebView style={this._setWebviewHeight()}
             automaticallyAdjustContentInsets={false}
             scrollEnabled={false}
             onNavigationStateChange={this.onNavigationStateChange.bind(this)}
             html={html}&gt;
  &lt;/WebView&gt;
  </code></pre>
  
  <p>Where: </p>
  
  <pre><code>_setWebviewHeight() {
   return {
    height: this.state.height,
    padding: 20,
   }
  }
  </code></pre>
  
  <p>And in this case I'm getting error and I am not able to get the height of content through state. What shall I do then?</p>
  
  <p>The idea of solution is taken from here: <a href="https://stackoverflow.com/questions/32952270/react-native-is-it-possible-to-have-the-height-of-a-html-content-in-a-webview">React native: Is it possible to have the height of a html content in a webview?</a></p>