title: React how to check props before passing in another component
body: <p>Lets say I have a component <code>&lt;MyComponent check={this.props} /&gt;</code>. This will call <code>MyComponent</code> class. Here I am doing something like this:</p>
  
  <pre><code>render(){
      const {user} = this.props
      return (){
          &lt;div&gt;Welcome {user.name}&lt;/div&gt;
          }
      }
  </code></pre>
  
  <p>In my container initially there is no <code>user.name</code> when the user is logged in then only <code>user.name</code> is available in props. In <code>componentWillMount</code> I have checked for <code>isLoggedIn</code> and if not I'm redirecting it, but in <code>render</code> method it checks for <code>user.name</code> property which is not available before login.</p>
  
  <p>If <code>isLoggedIn</code> is true then <code>&lt;MyComponent check={this.props} /&gt;</code> which calls my <code>MyComponent</code> should return a redirection or other.</p>
  
  <p>Does anyone have any idea how to implement this?</p>