title: Passing states between components
body: <p>I'm trying to do some actions based on the states of another component. I have a select box and i'm changing the state when the user changes the options.</p>
  
  <pre><code>&lt;div className="post_privacy_div float_left"&gt;
  
      &lt;select className="review_privacy_select" onChange={this.commentOption}&gt;
  
          &lt;option value="Comments with filter"&gt;Comments with filter&lt;/option&gt;
  
          &lt;option value="Enable comments"&gt;Enable all comments&lt;/option&gt;
  
          &lt;option value="Disable comments"&gt;Disable all comments&lt;/option&gt;
  
      &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Function</strong></p>
  
  <pre><code>commentOption(e) {
  
          this.setState({selectValue: e.target.value});
  }
  </code></pre>
  
  <p>So the state changing is successfully done. Now i want to pass this state into another component.How can i do it?</p>
  
  <p>Basically i'm trying to do this but in another component</p>
  
  <pre><code>   if (this.state.selectValue === 'Enable comments') {
  
                  this.setState({
  
                      pendingcomment: !this.state.pendingcomment,
  
                  })
  
              } else if (this.state.selectValue === 'Disable comments') {
  
                  this.setState({
  
                      pendingcomment: false,
                      allcomment: false,
  
                  })
  
              } else {
  
                  this.setState({
  
                      pendingcomment: true,
                      allcomment: true,
  
                  })
  
              }
  </code></pre>