Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: when module.hot is not truthy #1451

Merged
merged 1 commit into from May 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 10 additions & 2 deletions root.js
Expand Up @@ -17,13 +17,21 @@ if (process.env.NODE_ENV !== 'production') {
'Please use `import {hot} from "react-hot-loader"` instead'
);
}

// remove self from a cache
delete cache[module.id];

// setup hot for caller
exports.hot = hot(parent);
} else {
fallbackHot();
}
// setup hot for caller
exports.hot = hot(parent);
} else {
// prod mode
fallbackHot();
}

function fallbackHot() {
exports.hot = function (a) {
return a;
};
Expand Down