If you’re using React Hot Loader, it’s time to start looking at React Refresh Webpack Plugin, an EXPERIMENTAL Webpack plugin to enable “Fast Refresh” (which you might know from React Native) for React components. It’s also to be included with Create React App version 4.0 (now in alpha).
Installation per NPM/Yarn:
npm install -D @pmmmwh/react-refresh-webpack-plugin react-refresh
Once installed you must also adjust your Webpack and Babel configs to activate it.
React Refresh Webpack Plugin →
🙀 In case you’re a bit scared by that EXPERIMENTAL word in there, here’s what Dan Abramov – author of React Hot Loader, amongst many other things – says about it:
It’s much more “stable” than RHL ever was
— Dan Abramov (@dan_abramov) August 6, 2020