title: How to access parent component state in child component?
body: <p>I am using react-router(v3) for routing purpose in my app. I have some nested route and want to access parent component state in child component.</p>
  
  <p><strong>Route:</strong></p>
  
  <pre><code>&lt;Route component={Main}&gt;
     &lt;Route path="home" component={Home} /&gt;
  &lt;/Route&gt;
  </code></pre>
  
  <p><strong>Main Component(parent):</strong></p>
  
  <pre><code>export default class Main extends Component {
    constructor(prop){
      super(prop);
      this.state = {
        user : {}
      }
    }
  
    render(){
      return (
        &lt;div&gt;
          Main component
        &lt;/div&gt;
      )
    }
  }
  </code></pre>
  
  <p><strong>Home Component(child):</strong></p>
  
  <pre><code>export default class Home extends Component {
    constructor(prop){
      super(prop);
    }
  
    render(){
      return (
        &lt;div&gt;
          Main component
          want to access user data here. how to access user from parent component?
        &lt;/div&gt;
      )
    }
  }
  </code></pre>
  
  <p>In <code>Home</code> component i want to access user data, that is in parent component <code>Main</code>. Is there any way to access parent component state in child component ?</p>