Skip to content

Commit ec3447f

Browse files
authored
fix: when module.hot is not truthy (#1451)
1 parent 1afb27a commit ec3447f

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

root.js

+10-2
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,21 @@ if (process.env.NODE_ENV !== 'production') {
1717
'Please use `import {hot} from "react-hot-loader"` instead'
1818
);
1919
}
20+
2021
// remove self from a cache
2122
delete cache[module.id];
23+
24+
// setup hot for caller
25+
exports.hot = hot(parent);
26+
} else {
27+
fallbackHot();
2228
}
23-
// setup hot for caller
24-
exports.hot = hot(parent);
2529
} else {
2630
// prod mode
31+
fallbackHot();
32+
}
33+
34+
function fallbackHot() {
2735
exports.hot = function (a) {
2836
return a;
2937
};

0 commit comments

Comments
 (0)