title: react native get TextInput value
body: <p>I am stuck with a very simple problem. I have login form with username, password and button. In my button handler, I try to get the textinput value. But always get undefined value. Am I missing something?</p>
  
  <pre><code>render() {
          &lt;ExScreen
            headerColor={this.state.headerColor}
            scrollEnabled={this.state.enableScroll}
            style={styles.container} &gt;
            &lt;View &gt;
              &lt;View  &gt;
                &lt;View style={[styles.inputContainer]} &gt;
                  &lt;TextInput
                    ref= "username"
                    onChangeText={(text) =&gt; this.setState({text})}
                    value={this.state.username}
                  /&gt;
                &lt;/View&gt;
   &lt;Button style={{color: 'white', marginTop: 30, borderWidth: 1, borderColor: 'white', marginLeft: 20*vw, marginRight: 20*vw, height: 40, padding: 10}} 
               onPress={this._handlePress.bind(this)}&gt;
                Sign In
              &lt;/Button&gt;   
  ...
   _handlePress(event) {
      var username=this.refs.username.value;
  </code></pre>