title: React.js pass data between components flow
body: <p>I have created three basic components.</p>
  
  <p>A renders both the components B and C
  B is like header containg tabs 1,2,3
  C is the first page on which there are two forms, one shows at a time. On showing first form i need to show tab one 1 in B component. On showing second form i need to show tab 3 in B component.</p>
  
  <p>I just want to pass the data from C component on the basis of which form is showing to B component.</p>
  
  <p>I put state on C component and tried to use same this.state.data or this.props.data for no value coming in B controller.</p>
  
  <p><strong>A.jsx</strong></p>
  
  <pre><code>import React from 'react';
  import B from './B.jsx';
  import C from './C.jsx'
  class A extends React.Component {
      constructor(props) {
          super();
          this.state = {
              show : '1',
          }
      }
      render() {
          return (
              &lt;div&gt;{this.props.show}
                  &lt;B /&gt;
                  &lt;C/&gt;
              &lt;/div&gt;
          )
      }
  }
  
  export default A;
  </code></pre>
  
  <p><strong>B.jsx</strong></p>
  
  <pre><code>import React from 'react';
  
  class B extends React.Component {
      constructor(props) {
          super(props);
          this.state = {
              show : '1',
          }
      }
      render() {
          return (
              //html code here
          )
      }
  }
  </code></pre>
  
  <p><strong>C.jsx</strong></p>
  
  <pre><code>class C extends React.Component {
      constructor(props) {
          super(props);
          this.state = {
              show : '1',
          }
      }
      render() {
          return (
              //html code here
          )
      }
  }
  </code></pre>