mirror of
https://github.com/zhigang1992/create-react-app.git
synced 2026-05-28 16:44:53 +08:00
This reverts commit b2cf28b7f1 and reapplies #6406.
This commit is contained in:
18
packages/react-dev-utils/webpackHotDevClient.js
vendored
18
packages/react-dev-utils/webpackHotDevClient.js
vendored
@@ -106,7 +106,7 @@ function handleSuccess() {
|
||||
tryApplyUpdates(function onHotUpdateSuccess() {
|
||||
// Only dismiss it when we're sure it's a hot update.
|
||||
// Otherwise it would flicker right before the reload.
|
||||
ErrorOverlay.dismissBuildError();
|
||||
tryDismissErrorOverlay();
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -140,19 +140,15 @@ function handleWarnings(warnings) {
|
||||
}
|
||||
}
|
||||
|
||||
printWarnings();
|
||||
|
||||
// Attempt to apply hot updates or reload.
|
||||
if (isHotUpdate) {
|
||||
tryApplyUpdates(function onSuccessfulHotUpdate() {
|
||||
// Only print warnings if we aren't refreshing the page.
|
||||
// Otherwise they'll disappear right away anyway.
|
||||
printWarnings();
|
||||
// Only dismiss it when we're sure it's a hot update.
|
||||
// Otherwise it would flicker right before the reload.
|
||||
ErrorOverlay.dismissBuildError();
|
||||
tryDismissErrorOverlay();
|
||||
});
|
||||
} else {
|
||||
// Print initial warnings immediately.
|
||||
printWarnings();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,6 +179,12 @@ function handleErrors(errors) {
|
||||
// We will reload on next success instead.
|
||||
}
|
||||
|
||||
function tryDismissErrorOverlay() {
|
||||
if (!hasCompileErrors) {
|
||||
ErrorOverlay.dismissBuildError();
|
||||
}
|
||||
}
|
||||
|
||||
// There is a newer version of the code available.
|
||||
function handleAvailableHash(hash) {
|
||||
// Update last known compilation hash.
|
||||
|
||||
Reference in New Issue
Block a user