热的重新装填现在出来了,但我有很多问题,使它的工作。
起初,我在redux存储中有标准的module.hot.accept("../reducers", () => {代码,但这会导致问题。在注释掉这段代码之后,我开始获得Cannot read property 'length' of undefined。
我创建了一个新项目react-native init test,每次文件更改时都会得到相同的错误。
ExceptionsManager.js:61 Cannot read property 'length' of undefined在项目中是否需要做些什么才能使热重装工作?
更新
这仍然是无记录的,造成的问题比它的价值更多。目前,我正在使用redux-持久化的活重加载。
发布于 2016-08-24 17:18:06
Facebook终于记录了如何使用热重加载或热模块替换。
https://facebook.github.io/react-native/blog/2016/03/24/introducing-hot-reloading.html
api与Webpack略有不同。
if (module.hot) {
module.hot.accept(() => {
const nextRootReducer = require("../reducers").default;
store.replaceReducer(nextRootReducer);
});
}https://stackoverflow.com/questions/36163443
复制相似问题