title: react native understanding textInput component
body: <p>Below I have some code that works fine (its based off <a href="https://facebook.github.io/react-native/docs/handling-text-input.html" rel="nofollow noreferrer">this</a> tutorial) however I don't understand why it works. Specifically I don't understand how the TextInput component knows that I want to set "thing" to the value of the TextInput. It would make more sense to me if there was something like <code>thing = TextInput.value</code> but as it is currently I don't understand it. If someone could explain to me the syntax here or direct me towards some resources on it that would be great. Please note, I have read <a href="https://facebook.github.io/react-native/docs/textinput.htm" rel="nofollow noreferrer">this</a> and the tutorial linked above but I still don't understand. Also in case this is not clear, the code below is stored in App.js and all it does is copy the current value of the TextInput to a Text component right below the TextInput.</p>
  
  <pre><code>import React, { Component } from 'react';
  import { AppRegistry, Text, TextInput, View} from 'react-native';
  
  export default class myapp extends Component {
      constructor(props) {
          super(props);
          this.state = {thing: ''};
      }
  
      render(){
          return (
              &lt;View style={{padding: 30}}&gt;
                  &lt;TextInput placeholder="default" onChangeText={(thing) =&gt; this.setState({thing})}/&gt;
                  &lt;Text&gt;{this.state.thing}&lt;/Text&gt;
              &lt;/View&gt;
          );
      }
  }
  </code></pre>