I spend hours searching why it always reloaded the page and not patching the component with my webpack setup.
I hope this will be useful to the next person trying to use hmr with webpack.
The important part is the two options
devServer: {
liveReload: false,
hot: true,
}
and also double brackets in .babelrc. When you give an additional option to a plugin, it needs to be an array.
I spend hours searching why it always reloaded the page and not patching the component with my webpack setup. I hope this will be useful to the next person trying to use hmr with webpack. The important part is the two options
and also double brackets in
.babelrc
. When you give an additional option to a plugin, it needs to be an array.