Open wzup opened 6 years ago
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
Description
More explanation
Environment
React Hot Loader version: recent stable
node -v
: 8.9.4npm -v
: 5.6.0Question
What is the difference between
react-hot-loader
andwebpack-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
andwebpack-hot-middleware
).Do I need to use
react-hot-loader
if I usewebpack-serve
? Why? Could you please explain what exactlyreact-hot-loader
does?