1、在配置完webpack.config.js准备进行热加载开发时,修改React内容浏览器不会自动局部刷新,而且会console出一些提示:

The following modules couldn't be hot updated: (They would need a full reload!)

很有可能的一个原因是,项目中没有添加react-hot-loader

解决的办法是:npm i --save-dev react-hot-loader, 接着在webpack.config.js中修改:{test:/\.jsx$/,exclude:/node_modules/,loaders:['react-hot','babel']}

相关文章:

  • 2021-09-10
  • 2021-10-08
  • 2021-08-24
  • 2022-12-23
  • 2021-04-29
  • 2022-12-23
  • 2022-01-10
猜你喜欢
  • 2021-12-15
  • 2022-12-23
  • 2021-07-05
  • 2020-05-10
  • 2022-12-23
  • 2021-07-19
  • 2021-07-17
相关资源
相似解决方案