title: React - Change state in child component
body: <p>I trying to change my state in another component. I have passed the state by <strong>props</strong></p>
  
  <pre><code>  constructor(props) {
      super(props);
  
        this.handleClick = this.handleClick.bind(this);  
  
        this.state = {
            isOpen: false
        };  
    } 
  
  &lt;MobileContent isOpen={this.state.isOpen} /&gt;
  </code></pre>
  
  <p>In my MobileContent component i want to change the state when i click on the element. </p>
  
  <pre><code>class MobileContent extends Component {
  
    render() {
      if (this.props.isOpen) {
          return (
              &lt;Grid fluid&gt;
                  &lt;div className="mobileContent"&gt;
                  &lt;Row center="xs"&gt;
                      &lt;Col xs={12}&gt;
                      &lt;span className="button"&gt;Hello, world!&lt;/span&gt;
                      &lt;span className="close" onClick={this.handleClick} &gt;X&lt;/span&gt;              
                      &lt;/Col&gt;                 
                  &lt;/Row&gt;
                  &lt;/div&gt;
              &lt;/Grid&gt;
          );
      }
      return null;
    }
  }
  
  export default MobileContent;
  </code></pre>
  
  <p>Thanks for the help !! </p>