Fix infinite loop

This commit is contained in:
zodern
2021-09-10 16:18:06 -05:00
committed by filipenevola
parent d63ff51da1
commit fffebc20e3

View File

@@ -16,9 +16,18 @@ if (
hmrEnabled &&
enabled
) {
let inBefore = false;
module.hot.onRequire({
before(module) {
if (inBefore) {
// This is a module required while loading the react refresh runtime
// Do not initialize it to avoid an infinite loop
return;
}
inBefore = true;
init(module);
inBefore = false;
}
});