How should a hot reboot work in a native response?

There is no hot reset right now, but I have a lot of problems to get it working.

At first, I had the standard module.hot.accept("../reducers", () => { code in my redux store, but that caused problems. After commenting on this code, I started getting Cannot read property 'length' of undefined .

I created a new react-native init test project, and every time the file was modified, I get the same error.

 ExceptionsManager.js:61 Cannot read property 'length' of undefined 

Is there something that needs to be done in the project to make a hot reboot?

Update

It is still undocumented and causes more problems than its value. Right now I'm using rebx-persist with live reboot.

+5
source share
1 answer

Facebook has finally documented how to use Hot Reloading or Hot Module Replacement.

https://facebook.imtqy.com/react-native/blog/2016/03/24/introducing-hot-reloading.html

Api is a bit different than Webpack

 if (module.hot) { module.hot.accept(() => { const nextRootReducer = require("../reducers").default; store.replaceReducer(nextRootReducer); }); } 
+2
source

Source: https://habr.com/ru/post/1245576/


All Articles