Skip to content

Commit

Permalink
fix: page doesn't get refreshed when FAST_REFRESH=false (facebook#9884)
Browse files Browse the repository at this point in the history
Co-authored-by: Ian Schmitz <[email protected]>
  • Loading branch information
2 people authored and abhiisheek committed May 19, 2023
1 parent b8168a8 commit ddb5b0b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/react-dev-utils/webpackHotDevClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,8 @@ function tryApplyUpdates(onHotUpdateSuccess) {
}

function handleApplyUpdates(err, updatedModules) {
const hasReactRefresh = process.env.FAST_REFRESH !== 'false';
// NOTE: This var is injected by Webpack's DefinePlugin, and is a boolean instead of string.
const hasReactRefresh = process.env.FAST_REFRESH;
const wantsForcedReload = err || !updatedModules || hadRuntimeError;
// React refresh can handle hot-reloading over errors.
if (!hasReactRefresh && wantsForcedReload) {
Expand Down

0 comments on commit ddb5b0b

Please sign in to comment.