Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create React App integrated in an existing application #4133

Closed
natdm opened this issue Mar 9, 2018 · 7 comments
Closed

Create React App integrated in an existing application #4133

natdm opened this issue Mar 9, 2018 · 7 comments
Labels

Comments

@natdm
Copy link

natdm commented Mar 9, 2018

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.

@sunnyw1212
Copy link

did you ever figure out a solution to this?

@natdm
Copy link
Author

natdm commented Mar 24, 2018

Nope.

@sunnyw1212
Copy link

our work app has a similar structure to yours. i was messing around with it today and found out you can get live-reloading if you run npm start in the react app and have your server load localhost:3000/bundle.js instead of the final production version of bundle.js

@natdm
Copy link
Author

natdm commented Mar 27, 2018 via email

@sunnyw1212
Copy link

nope. still don't have true live-reload, but i figure it's still a better dev workflow than having to rebuild every time you want to see a change

@DarrenN
Copy link

DarrenN commented Apr 11, 2018

Have a look at #3071

@stale
Copy link

stale bot commented Nov 2, 2018

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.

@stale stale bot added the stale label Nov 2, 2018
@Timer Timer closed this as completed Nov 2, 2018
@lock lock bot locked and limited conversation to collaborators Jan 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants