title: Share data from generated HTML to React
body: <p>I have existing PHP application,
  I want to create rich component with React.</p>
  
  <p>In my application I don't have api to React integration, I think the easiest way could be just print data from PHP to HTML as JSON and load this data from React.</p>
  
  <p>For illustration:</p>
  
  <pre><code>&lt;?php $data = ..some data loaded from DB.. ?&gt;
  &lt;div id="react-component-root" data="&lt;?= json($data) ?&gt;"&gt;
  </code></pre>
  
  <p>Question is: What is the best solution to share data from PHP generated HTML to React?</p>
  
  <p>Best = easy and working</p>