title: Set state before render react
body: <p>I have the <code>App.js</code>, inside of it a component. Name it <code>Example</code>. I want to set the <code>Example</code>'s props with the <code>App.state</code>s. For an example, <code>Example</code> has the props: <code>name</code>,<code>id</code>. In the <code>App</code> i want to fetch the data i want from the server, and set it as the <code>App</code>'s states, then assign them to the <code>Example</code>'s props, before the app renders it. The problem here is that i read about <code>componentWillMount()</code>, but the React documentation says that it's not the best way. Then, what's the best way?</p>