You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My project utilizes react18 createRoot for rendering and is configured with Node Express(), webpack-dev-middleware, and webpack-hot-middleware.
After upgrading from webpack 4 to webpack 5, I faced an issue where the webpack-hot-middleware didn't hot reload the view after API updates.
To address this issue, I decided to use the react-refresh-webpack-plugin, which resolved the problem. However, it introduced another issue: after API updates, an error would occur. Warning: You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.
I managed to resolve this issue by removing the if (module.hot) { module.hot.accept() } from index.js. Is this a valid solution?
The text was updated successfully, but these errors were encountered:
My project utilizes react18 createRoot for rendering and is configured with Node Express(), webpack-dev-middleware, and webpack-hot-middleware.
After upgrading from webpack 4 to webpack 5, I faced an issue where the webpack-hot-middleware didn't hot reload the view after API updates.
To address this issue, I decided to use the react-refresh-webpack-plugin, which resolved the problem. However, it introduced another issue: after API updates, an error would occur.
Warning: You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it.
I managed to resolve this issue by removing the
if (module.hot) { module.hot.accept() }
from index.js. Is this a valid solution?The text was updated successfully, but these errors were encountered: