title: How to call action in react before the first load of page?
body: <p>I have an action in <code>componentDidMount</code> that is called by click</p>
  
  <pre><code>onBtnClick = (data: any) =&gt; {
    this.props.componentDidMount(data);
  };
  
  &lt;button onClick={this.onBtnClick}&gt; Toogle posts &lt;/button&gt;;
  {
    this.props.data.map((el: any) =&gt; &lt;li key={el.id}&gt;{el.title}&lt;/li&gt;);
  }
  </code></pre>
  
  <p>How can I call <code>componentDidMount</code> before the first page load? Without using onClick function</p>