1. 首页
  2. 数据库
  3. 其它
  4. react+webpack热更新、保存react状态

react+webpack热更新、保存react状态

上传者: 2021-02-01 18:29:48上传 PDF文件 31.6KB 热度 33次
1、先搭建一个webpack+react的项目。 2、webpack.config.js中配置 module.exports = { //... devServer: { hot: true } }; module.exports = { //... plugins: [ //.. new webpack.HotModuleReplacementPlugin() ], }; 3、index.tsx中配置,我用的是typesctipt,不然的话就是index.js,也就是项目入口的js文件 let _module
下载地址
用户评论