From ddb5b0b2c86b963a9aadb715acb845587cdd707b Mon Sep 17 00:00:00 2001 From: Jirat Ki Date: Tue, 27 Oct 2020 02:53:44 +0800 Subject: [PATCH] fix: page doesn't get refreshed when FAST_REFRESH=false (#9884) Co-authored-by: Ian Schmitz --- packages/react-dev-utils/webpackHotDevClient.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/react-dev-utils/webpackHotDevClient.js b/packages/react-dev-utils/webpackHotDevClient.js index 16198d3374a..db87aba7d0c 100644 --- a/packages/react-dev-utils/webpackHotDevClient.js +++ b/packages/react-dev-utils/webpackHotDevClient.js @@ -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) {