title: Set state in component from input
body: <p>I am trying to set the state of an input in my component, and use it in my app.js. How am I able to do this with props? I tried <code>onChangeText={(tips) =&gt; this.setState({comment})}</code> but I only get undefined..</p>
  
  <pre><code>const Comments = (props) =&gt; {
    return (
      &lt;View style={styles.container}&gt;
  &lt;Input style={styles.field}
    autoCorrect={false}
    autoCapitalize="none"
    onChangeText={props.onChangeText}
    placeholder="Skriv en kommentar..."
  /&gt;
  &lt;Button rounded style={styles.button} onPress={() =&gt; props.addComment(props.id)}&gt;
    &lt;Text style={styles.buttonText}&gt;Kommenter&lt;/Text&gt;
  &lt;/Button&gt;
  &lt;/View&gt;
    )
  }
  export { Comments };
  </code></pre>
  
  <p>In my app.js I have:</p>
  
  <p>My app.js</p>
  
  <pre><code>    export default class Home extends Component {
      constructor(props){
      super(props);
      this.state = {
        comment: '',
      }
     newComment = (comment) =&gt; {
        change = (comment) =&gt; this.setState(comment)
        alert(comment)
     }
    renderItem = ({ item, index }) =&gt; {
     return (
         &lt;Comments
            addComment={this.newComment}
            comments={this.state.comment}
            onChangeText={this.change}
          /&gt;
     )
    }
   }
  </code></pre>