Skip to content

Commit

Permalink
Allow Suspense Mismatch on the Client to Silently Proceed
Browse files Browse the repository at this point in the history
This fixes but isn't actually the semantics that we want this case to have.
  • Loading branch information
sebmarkbage committed Sep 28, 2019
1 parent ef280be commit 15ee6ca
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/react-reconciler/src/ReactFiberHydrationContext.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,11 +404,10 @@ function skipPastDehydratedSuspenseInstance(
let suspenseState: null | SuspenseState = fiber.memoizedState;
let suspenseInstance: null | SuspenseInstance =
suspenseState !== null ? suspenseState.dehydrated : null;
invariant(
suspenseInstance,
'Expected to have a hydrated suspense instance. ' +
'This error is likely caused by a bug in React. Please file an issue.',
);
if (suspenseInstance === null) {
// This Suspense boundary was hydrated without a match.
return nextHydratableInstance;
}
return getNextHydratableInstanceAfterSuspenseInstance(suspenseInstance);
}

Expand Down

0 comments on commit 15ee6ca

Please sign in to comment.