title: Updating WebView Javascript in React Native
body: <p>I'm having trouble updating my WebView values based on user input in React Native. I'm trying to make charts in WebView using D3.js, and the chart displayed is depending on user input. 
  Here is an example of my problem, the HTML times clicked is not being updated. I have tried using .reload() on webview ref also, but this just gives me a blank html instead.</p>
  
  <pre><code>    // @flow
  'use strict';
  import React, { Component } from 'react';
  import {
    StyleSheet,
    View,
    Image,
    Text,
    TouchableHighlight,
    WebView
  } from 'react-native';
  
  export default class WebViewTest extends Component {
  
    constructor(props) {
      super(props);
      this.state = {
      timesClicked : 0
    };
    this._onPressButton = this._onPressButton.bind(this);
    this.generateJSCode = this.generateJSCode.bind(this);
    }
  
    _onPressButton() {
      let timesClicked = this.state.timesClicked++;
      console.log(timesClicked + " Clicked ");
      this.setState({
        timesClicked: this.state.timesClicked++
      });
    }
  
    generateJSCode() {
      console.log("Times clicked: " + this.state.timesClicked);
      let jsCode = `document.getElementById("content").innerHTML = "HTML Times clicked: ${this.state.timesClicked}";`;
      return jsCode;
    }
  
    render() {
      let html = `
          &lt;div id="content"&gt;
              This is my name
          &lt;/div&gt;
      `;
  
      return (
          &lt;View style={styles.container}&gt;
            &lt;TouchableHighlight onPress={this._onPressButton}&gt;
              &lt;Text&gt;Press me to increase click&lt;/Text&gt;
            &lt;/TouchableHighlight&gt;
            &lt;Text&gt;React Native times clicked: {this.state.timesClicked}&lt;/Text&gt;
              &lt;WebView
                  style={styles.webView}
                  source={{html : html}}
                  injectedJavaScript={this.generateJSCode()}
                  javaScriptEnabledAndroid={true}
              &gt;
              &lt;/WebView&gt;
          &lt;/View&gt;
      );
    }
  }
  
  let styles = StyleSheet.create({
  container: {
      flex: 1,
      backgroundColor: '#fff',
      margin: 30
  },
  webView: {
      backgroundColor: '#fff',
      height: 350,
  }
  });
  </code></pre>