Skip to content

Commit 15ee6ca

Browse files
committed
Allow Suspense Mismatch on the Client to Silently Proceed
This fixes but isn't actually the semantics that we want this case to have.
1 parent ef280be commit 15ee6ca

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

packages/react-reconciler/src/ReactFiberHydrationContext.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -404,11 +404,10 @@ function skipPastDehydratedSuspenseInstance(
404404
let suspenseState: null | SuspenseState = fiber.memoizedState;
405405
let suspenseInstance: null | SuspenseInstance =
406406
suspenseState !== null ? suspenseState.dehydrated : null;
407-
invariant(
408-
suspenseInstance,
409-
'Expected to have a hydrated suspense instance. ' +
410-
'This error is likely caused by a bug in React. Please file an issue.',
411-
);
407+
if (suspenseInstance === null) {
408+
// This Suspense boundary was hydrated without a match.
409+
return nextHydratableInstance;
410+
}
412411
return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
413412
}
414413

0 commit comments

Comments
 (0)