Skip to content

Commit

Permalink
Handle SuspenseListComponent getting retried (#16745)
Browse files Browse the repository at this point in the history
This happens for example when a deleted boundary transfers its pending
promises to the list so that the list can be retried.

This wasn't caught by unit tests because this flag wasn't on in those
tests.
  • Loading branch information
sebmarkbage committed Sep 11, 2019
1 parent 2c98af7 commit e04f425
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ import {
HostRoot,
ClassComponent,
SuspenseComponent,
SuspenseListComponent,
FunctionComponent,
ForwardRef,
MemoComponent,
Expand Down Expand Up @@ -2223,6 +2224,9 @@ export function resolveRetryThenable(boundaryFiber: Fiber, thenable: Thenable) {
retryTime = suspenseState.retryTime;
}
break;
case SuspenseListComponent:
retryCache = boundaryFiber.stateNode;
break;
default:
invariant(
false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ describe('ReactSuspenseList', () => {
ReactFeatureFlags = require('shared/ReactFeatureFlags');
ReactFeatureFlags.debugRenderPhaseSideEffectsForStrictMode = false;
ReactFeatureFlags.replayFailedUnitOfWorkWithInvokeGuardedCallback = false;
ReactFeatureFlags.enableSuspenseServerRenderer = true;
React = require('react');
ReactNoop = require('react-noop-renderer');
Scheduler = require('scheduler');
Expand Down

0 comments on commit e04f425

Please sign in to comment.