title: Displaying a server side rendered reactJS component within a PHP application
body: <p>I have previously used reactJS on another project.
  When building said project i noticed a downfall namely the loss of SEO benefit associated with JS rendered components.</p>
  
  <p>I am rebuilding an old project and I would like to replace some of the Javascript with ReactJS.</p>
  
  <p>For example, a multi step form - I'd like to replace it with a stateful component that displays the correct stage as required.</p>
  
  <p>I would however like to maintain the SEO aspects of the page by having the first step spiderable.</p>
  
  <p>To achieve this my research implies that I should be using React's <code>React.renderComponentToString</code></p>
  
  <p>Having researched the issue my thought process is that I should render the components server side using node.js and then serve them up within the browser. The component is then re-added per say to add the client side functionality. My first question is as to whether this is a suitable approach? Is there a much simpler approach that I have overlooked?</p>
  
  <p>Pete Hunt mentions here (<a href="https://groups.google.com/forum/#!msg/reactjs/eUespJPdyas/hmJywyo9ZSwJ" rel="nofollow noreferrer">https://groups.google.com/forum/#!msg/reactjs/eUespJPdyas/hmJywyo9ZSwJ</a>) that Instagram uses/used Django and had a setup similar to what I imagined.</p>
  
  <p>My app is written in php using phalcon. My question essentially relates to this statement: </p>
  
  <blockquote>
    <p>Node will then return the HTML that makes up the component. Django
    takes that HTML and inserts it into the DOM via normal Django
    templates.</p>
  </blockquote>
  
  <p>How do I go about doing this within PHP? I don't want this component rendered behind the scenes and used when requested, but rather rendered when required by PHP with passed parameters.</p>
  
  <p>I found this question (<a href="https://stackoverflow.com/questions/10048978/sending-messages-from-php-to-node-js">Sending messages from PHP to Node.js</a>) which got me thinking that one approach is to simply use CURL to query the port my node instance is listening on to get the html which I then output.</p>
  
  <p>My concern here is that all my experiences with CURL have suggested that it is very slow. I don't want my page load times to decrease dramatically just to get some SEO benefit.</p>
  
  <p>Could anyone advise on the above questions/my direction?</p>
  
  <p>Many Thanks</p>