The best way to pass data from vanilla Javascript to React? : <p>I am integrating some react+redux code into a website that is made completely in vanilla JS(with some JQuery), CSS, and HTML. The plan is to integrate the entire website into React, but won’t be complete for awhile and for right now the best plan is to integrate the required react code into the current stack. This would be easy if both the react code and the vanilla JS code didn’t have to communicate with each other, but that unfortunately isn’t the case.  In particular, I need to be able to pass some of the data from all the vanilla JS already written into particular React components. I am having trouble in deciding the best way to do this. I found this great article which explains how to do this with a publisher/subscriber method, linked here:</p>

<p><a href="http://www.primaryobjects.com/2017/05/08/integrating-react-with-an-existing-jquery-web-application/" rel="nofollow noreferrer">http://www.primaryobjects.com/2017/05/08/integrating-react-with-an-existing-jquery-web-application/</a></p>

<p>This way seems fine, but it is a little convoluted for my use case and will require some significant code refactoring in order to implement properly. Is there an alternative way to accomplish my goal?</p>

<p>NOTE: The React code uses JSX and not JS.</p>
