mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-03-27 22:54:46 +08:00
Yellow boxes for HMR errors
Reviewed By: vjeux Differential Revision: D2795143 fb-gh-sync-id: fd5c92af511258bb1252d991e994a8c37657644e
This commit is contained in:
committed by
facebook-github-bot-5
parent
494d607e28
commit
e798817e5a
@@ -99,18 +99,20 @@
|
||||
var mod = modules[id];
|
||||
|
||||
if (!mod) {
|
||||
console.error(
|
||||
console.warn(
|
||||
'Cannot accept unknown module `' + id + '`. Make sure you\'re not ' +
|
||||
'trying to modify something else other than a module ' +
|
||||
'(i.e.: a polyfill).'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!mod.module.hot) {
|
||||
console.error(
|
||||
console.warn(
|
||||
'Cannot accept module because Hot Module Replacement ' +
|
||||
'API was not installed.'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
if (mod.module.hot.acceptCallback) {
|
||||
@@ -120,7 +122,7 @@
|
||||
|
||||
mod.module.hot.acceptCallback();
|
||||
} else {
|
||||
console.log(
|
||||
console.warn(
|
||||
'[HMR] Module `' + id + '` can\'t be hot reloaded because it ' +
|
||||
'doesn\'t provide accept callback hook. Reload the app to get the updates.'
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user