-
-
Notifications
You must be signed in to change notification settings - Fork 27k
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
Reload on Save is triggering full HMR reload #402
Comments
There is by design. Hot reloading is currently only supported for CSS. React Hot Loader is not included in this setup because it’s not stable enough to be recommended as a default setup for everyone. If it’s ever stable enough, we will include it in the future. |
Thanks I figured it was something like this. |
@gaearon hot reload is the primary reason I came looking here. If you could have a dev channel with hot reload, a lot of people would find it useful. |
One step at a time 😉 |
So, you have to eject to get HMR working at the component level. Just making sure. |
Technically you can write a top-level |
@aleemb If you’d like, you can contribute “Adding Storybook” to the Usage Guide. |
For those reaching here from google, you can technically add
to your 💀 use at your own risk 💀 (imho still better than ejecting) |
It will work but not preserve the state, which is not much better than a full refresh. Depends on whether you use something like Redux I guess 😄 . |
@gaearon by not preserving state, do you mean it's re-mounting components and thus resetting state? |
@jonstuebe exactly. it will reset internal state |
I'm using redux with react, but I cant find any modern example on how to use it with hmr without loosing the redux state :( |
@cubodehelio What have you tried? |
hey @gaearon it turns out that i'm still learning here, sometimes everything works just fine and others it doesn't, normal stuff. Thanks for you work! |
If you create a new issue describing what you've tried (and maybe attaching a project) we could help. |
Was surprised to find that hot component reloading didn't work out of the box. Should have read the README. Would it be possible to have this enabled with an experimental flag? |
No until it is implemented in a proper stable way. We are adding the error box in 0.10 which is a good first step towards this. We will look at enabling it for functional components at some point after that. |
@dzannotti I tried your snippet, and while it works for regular I don't really understand how hot works. Any advice? |
Hi It's been a while since I have set up a new React project with HMR functionality so I apologize if this is known and/or expected.
When I
create-react-app new-app
andnpm start
updates toApp.js
are reloaded but the webpack HMR is doing a full reload.My specific steps were
create-react-app
npm start
(browser window opened automaticallyto
I know there are some limitations with HMR and react hot reloader so if this is expected per the configuration then I'll quickly close this issue but it was surprising behavior to me
The text was updated successfully, but these errors were encountered: