Skip to content

Throw on hydration mismatch and force client rendering if boundary hasn't suspended within concurrent root #22629

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

Merged
merged 15 commits into from
Nov 9, 2021
Prev Previous commit
Next Next commit
update error message part2...
  • Loading branch information
salazarm committed Oct 26, 2021
commit a55dcafde45d4b001483726ae9db39dac46ee0d4
7 changes: 6 additions & 1 deletion packages/react-reconciler/src/ReactFiberThrow.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,12 @@ function throwException(
suspenseBoundary.flags |= ForceClientRender;
return;
}
if (hasShouldCapture && value && value.message === 'Hydration mismatch') {
if (
hasShouldCapture &&
value &&
value.message ===
'An error occurred during hydration. The server HTML was replaced with client content'
) {
// swallow mismatch error
return;
}
Expand Down
7 changes: 6 additions & 1 deletion packages/react-reconciler/src/ReactFiberThrow.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,12 @@ function throwException(
suspenseBoundary.flags |= ForceClientRender;
return;
}
if (hasShouldCapture && value && value.message === 'Hydration mismatch') {
if (
hasShouldCapture &&
value &&
value.message ===
'An error occurred during hydration. The server HTML was replaced with client content'
) {
// swallow mismatch error
return;
}
Expand Down