title: React Automatically Press Button
body: <p>While setting up the authentication , I came across a problem i.e, I can only trigger the authentication if I trigger it through a button.</p>
  
  <p>So ,  I woulld love to know if t here was a way to automatically trigger a button's Onclick event in React.</p>
  
  <pre><code>render() {
  const { isAuthenticated } = this.props.auth;
  
  return (
   &lt;div&gt;
     {
       !isAuthenticated() &amp;&amp; (
        &lt;Button
        bsStyle="primary"
        className="btn-margin"
        onClick={this.login.bind(this)}
      &gt;
        Login
      &lt;/Button&gt;
       )
     }
     { 
       isAuthenticated() &amp;&amp; (
        &lt;Button
        bsStyle="primary"
        className="btn-margin"
        onClick={this.logout.bind(this)}
      &gt;
        Logout
      &lt;/Button&gt;
       ) 
     }
   &lt;/div&gt;
    );
    }
  </code></pre>
  
  <p>The above code is my render method and I want to automatically trigger the Log In Button!</p>
  
  <p>Thanks in advance guys!</p>