Most of the articles I’ve seen so far, involve a workflow where the whole react app is compiled into a single file, lives under a single DOM element (typically: div#root).
I am working on a project, and I want to progressively replace existing jQuery components with React. So I am dealing with different challenges I have little experience with:
Some of the data I need to use lives in a JS object which is already prepared by the CMS on each page load. This is outside of React state of course. I somehow need to keep this data in-sync with the React state. If the jQuery code updates data through AJAX, I want my React components to follow through. Is this going to be an issue?
I don’t want a single monolithic compiled JS. I want separate react ‘widgets’, spread throughout the page, compiled separately, at different times, possibly by different developers. Doable? Sane?
For the previous point to work best, I need React + ReactDOM included just once in the page, not compiled separately into each widget. Is that ok?