-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
HMR not working with Stateless components? #465
Comments
I actually just got React Hot Loader 3 beta working on the 1.0 branch. See 5185c3a Would you like to try backporting this to the 0.x line? It should be fairly straightforward. React-hot-loader 3 beta has been stable in my testing. For backporting, just move things from the app.js to web-entry.js. |
Ok, implemented React Hot Loader 3 (well, removed babel-hmre-preset and used react-hot-loader's appcontainer) here: ryanswrt@3768886 It still doesn't seem to do HMR on stateless components when they're exported though? Stateless components inside stateful components update as expected - not sure if I've overlooked something here, is the transition to webpack-dev server also necessary? |
Just realized that npm link isn't the only thing required to update gatsby - the locally installed version also needs to be updated (of course). Doing so indicates that it isn't implemented properly in that commit yet - element being passed to the container is undefined, will resolve now |
Ok - it seems that with my implementation, |
You might be running into a similar problem as I did — make sure you've removed all the old hot reloading stuff (include the hapi-webpack plugin) and then run |
If the hapi-webpack plugin is removed, it needs to be replaced with webpack-dev-server right? Seems like quite a few things were re-written to support that - my naive swap runs the dev server but webpack doesn't seem to be compiling a serve able bundle (but tests pass?) |
Yes it does. Look at my commit, it's all there.
|
Currently, if I create a stateless component, updating it does not trigger HMR re-renders. It may be because https://github.com/danmartinez101/babel-preset-react-hmre is deprecated due to the transform family hot loaders being deprecated https://github.com/gaearon/react-transform-hmr - there are a few issues suggesting changing to https://github.com/gaearon/react-hot-loader 's V3 release (which is still in beta)
Has anyone tried this out?
The text was updated successfully, but these errors were encountered: