title: Best way to render components server-side? (No client-server linked, only on server)
body: <p>I was wondering how it's the best way to render server-side (without rendering this on the client) AND handle the state changes coming from async queries.</p>
  
  <p>Ideal Example:</p>
  
  <ol>
  <li>A server gets a requests to generate an HTML</li>
  <li>The server 'requires' a react component, passing some props</li>
  <li>The react component renders in the server, but it has to do an
  Ajax/Socket query to get some info. The event is sent and the
  response comes later.</li>
  <li>The react component changes the state, changing the output</li>
  <li>The HMTL generated is ready and with the latest state changes.</li>
  </ol>
  
  <p>What's happening here is that <code>ReactDOM.renderToStaticMarkup()</code>, as expected, doesn't wait for the component to finish the state changes (in this case, wait for the data and re-render).</p>
  
  <p><strong>To clarify:</strong></p>
  
  <p>There is no client here, it's not the typical SSR. I just need the full HTML on the server so I can do other actions later. The problme here is how to <em>wait</em> for those async calls and <strong>use the same component</strong> that I use on the client (it has states and some setStates).</p>
  
  <p>I'm assumming then only way is to have stateless components that just receive the props (doing all the socket handling previously and passing the data to each component). Right now the components are plain React, no Redux involved (that's why they are not stateless).</p>
  
  <p>Any other idea/approach?</p>
  
  <p>Thanks!</p>