mirror of https://github.com/status-im/metro.git
Reset hasError flag after HMR request
Summary: This got broken recently. As a result of this, when a module throws while being required, either by regular load or hot reload, the module object is marked as `hasError`. Form that point all subsequent HMR updates will fail because it will think the module failed while executing the factory but the failure could have been on an old run of an old factory. The fix is very simple: just reset `hasError` to false when accepting a module. Closes https://github.com/facebook/react-native/pull/7567 Differential Revision: D3310685 fbshipit-source-id: 2f0b48ab7432b7c221d0c88a019a28969a8862b2
This commit is contained in:
parent
56c3a581b0
commit
5fbd3751a0
|
@ -205,6 +205,7 @@ if (__DEV__) {
|
|||
if (factory) {
|
||||
mod.factory = factory;
|
||||
}
|
||||
mod.hasError = false;
|
||||
mod.isInitialized = false;
|
||||
require(id);
|
||||
|
||||
|
|
Loading…
Reference in New Issue