Description
If I have a react app nested in a server-side rendered page, how would I be able to get react to live-reload while in dev?
Right now, the server renders the page which has a DOM element the CRA app mounts to, to display within the application. It works great since we can't stop to rewrite the entire application just yet, but we can't get it to live-reload this way.
Basically my structure is
/app (server)
/public (css/js)
/ui (cra)
/views (server-side)
ui
is all the react code, and it gets transpiled and pushed to the /public
directory, where it then looks for div ids in /views
to mount to. The server generates the page, loads the JS, and React starts running inside the rendered pages, wherever it mounts.
How can I run this app and have react hot-reload to /public for me?
Thanks!
Also, this would be nice to do without ejecting.