-
Notifications
You must be signed in to change notification settings - Fork 801
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
Types are messed up after HMR applied to out of rendered tree components, dynamically loaded using react-loadable
#1050
Comments
Oh, that doesn't sounds good. |
This is super cool stuff - you found big 💩! React-Hot-Loader has a special thing, called hot replacement render, which tries to update component when it did not update them before. Problems here:
Thank you for this bug. |
Thanks for taking time to investigate and fix this problem. I will try your fix on the original, bigger repo and let you know what I have found. |
Released in 4.3.5 |
Description
For the components that are loaded dynamically using
react-loadable
, a HMR update applied to a component that was once rendered, but currently out of rendered tree appears to mess up RHL's internal component type cache.I created a small app to reproduce this case.
https://github.com/asyncmax/hmr-react-loadable
Clone the repo and run the following:
Open
http://localhost:8080
in the browser.Expected behavior
When you click radio buttons "Panel A" and "Panel B", you will see the bottom area changes to show a currently selected panel. These panels are loaded dynamically using
react-loadable
.Actual behavior
While "Panel B" is selected, change the
src/PanelA.jsx
file. It will trigger a HMR and changes will be applied. Now when you click "Panel A" and then "Panel B", the bottom area doesn't change and keep showing the content of "Panel A".In browser's console, there will be an error message showing two panels'
type
became the same.Environment
React Hot Loader version: 4.3.4
node -v
: 8.9.4npm -v
: 5.6.0yarn -v
: 1.9.44:
react-loadable
: 5.5.0Then, specify:
Reproducible Demo
https://github.com/asyncmax/hmr-react-loadable
The text was updated successfully, but these errors were encountered: