-
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
react-hot-loader with React.lazy not working #1447
Comments
Yep, there are some reported problems around it: |
you can use my project and reappear it : https://github.com/Blanceluo/webpacks
|
@Blanceluo My core stack:
I add const _rewireReactHotLoader = (config, env) => {
if (env === 'development') {
config.resolve.alias['react-dom'] = '@hot-loader/react-dom';
// babel-preset-react-app use it in dev
// hot-loader need babel-plugin-dynamic-import-node
removeInternalBabelPlugin('@babel/plugin-syntax-dynamic-import')(
config,
env
);
addBabelPlugin(
'dynamic-import-node' // hot loader need it
)(config, env);
}
return rewireReactHotLoader(config, env);
}; But hot loader is still not work with code splitting. react-scripts use Should i rm the babel plugin '@babel/plugin-syntax-dynamic-import' ? |
You may also need to introduce react-hot-loader, @hot-loader/react-dom just to support hooks... |
problem solved |
Description
react-hot-loader with React.lazy not working
Lazy loading component changes page cannot respond to changes
Expected behavior
When the lazy loading component changes, the page should respond to the change
Actual behavior
You need to refresh the page manually to see the new changes
Environment
React Hot Loader version: 4.12.20
Run these commands in the project folder and fill in their results:
node -v
: v12.16.1npm -v
: 6.13.4Then, specify:
Reproducible Demo
index.js
app.js
webpack.config.js
The text was updated successfully, but these errors were encountered: