title: React: How to close a modal from child opened from parent component
body: <p>I am opening child component modal by passing parent state as props to child. Is there any way to close the modal from child component itself without any interference from parent component.</p>
  
  <pre><code>class Parent extends Component {
  
      constructor(props) {
        super(props);
        this.showModal = this.showModal.bind(this);
        this.state = {
          showModal: false
        };
      }
      showModal() {
        this.setState({ showModal: true });
      }
      renderRow() {
        return (
          &lt;tr&gt;
            &lt;td onClick={() =&gt; this.setState({ show: true })}&gt;test&lt;/td&gt;
            &lt;ChildModal show={this.state.showModal}/&gt;
          &lt;/tr&gt;
        );
      }
  }
  
  
  class ChildModal extends Component {
    render() {
      return (
         &lt;Modal show={this.props.showModal}&gt;
              &lt;Modal.Header closeButton&gt; 
              &lt;Modal.Title&gt;Test&lt;/Modal.Title&gt; 
              &lt;/Modal.Header&gt;
              &lt;Modal.Body&gt; 
                  {/* some text */}
              &lt;/Modal.Body&gt;
          &lt;/Modal&gt;
      );
    }
  }
  </code></pre>
  
  <p>I want my child modal to be self contained. Is this even possible in react.</p>