More explanation
React Hot Loader version: recent stable
node -v: 8.9.4npm -v: 5.6.0What is the difference between react-hot-loader and webpack-hot-client (webpack-hot-middleware)?
I'm developing React+Express application.
I use Webpack to build assets and compile React.
I use webpack-serve as a dev server. This dev server features HMR out-of-the-box (it uses both, webpack-hot-client and webpack-hot-middleware).
Do I need to use react-hot-loader if I use webpack-serve? Why? Could you please explain what exactly react-hot-loader does?
I think it is a good idea, we have a lot of confusion between these packages.
react-hot-loader - client side library(+babel plugin), to perform React Component hot-updates.
webpack-hot-client - server side library, watches for fs changes and sends updates to a client.
webpack-hot-middleware - mixed (more client), some additional code, to make hot-module-replacement work. More concrete - accept updates from webpack-hot-client.
And you need __all this stuff__, as long react-hot-loader works atop webpack-hot-middleware, which is a part of webpack-hot-client.
@theKashey I have made a express server and use only webpack-hot-middleware(&webpack-dev-middleware) but without react-hot-loader, my react component(&mobx store) is already get hot updated.
so what's the purpose of react-hot-loader? is it really necessary?
@theKashey I have made a express server and use only webpack-hot-middleware(&webpack-dev-middleware) but without react-hot-loader, my react component(&mobx store) is already get hot updated.
so what's the purpose of react-hot-loader? is it really necessary?
I didn't get hot updated, but i have this confusion, too
so what's the purpose of react-hot-loader? is it really necessary?
Keep the state of your application. Global store, local store, hooks, refs, everything.
Without RHL you will get no more than full page refresh, potentially keeping some stuff like redux-store defined above hot
Most helpful comment
I think it is a good idea, we have a lot of confusion between these packages.