title: How to change parent's state from child component in react native?
body: <p>I have a parent component App.js which looks like this</p>
  
  <pre><code>  export default class App extends React.Component {
     constructor(){
       super();
       this.state = {
              registerusername: '',
       }
      }
  </code></pre>
  
  <p>Now I have a child component ChildComp.js which is a direct child of App.js and looks like this</p>
  
  <pre><code>  class ChildComp extends React.Component {
     render() {
      return (
      &lt;View&gt;
          &lt;TextInput
                  placeholder="Username"
                  placeholderTextColor = 'black'
                  onChangeText={(registerusername) =&gt; this.setState({registerusername})}
              /&gt;
         &lt;Text&gt;
           {this.state.registerusername.split(' ').map((word) =&gt; word &amp;&amp; '').join(' ')}
         &lt;/Text&gt;
      &lt;/View&gt;
         }
       }
  </code></pre>
  
  <p>I am attempting to change print the pizza logo just like the react native document under the TextInput field. I am having a hard time understanding how I can do this when the state, <code>registerusername</code> is in parent component and the ChildComp is stateless. I am doing `this.setState({registerusername})} in my ChildComp but I dont think it is referencing the parent's state.  </p>