Skip to content

Commit

Permalink
Remove logic for multiple error recovery attempts (facebook#23227)
Browse files Browse the repository at this point in the history
This deletes some internal behavior that was only used by
useOpaqueIdentifier, as an implementation detail: if an update is
scheduled during the render phase, and something threw an error, we
would try rendering again, either until there were no more errors or
until there were no more render phase updates. This was not a publicly
defined behavior — regular render phase updates are accompanied by
a warning.

Because useOpaqueIdentifier has been replaced by useId, and does not
rely on this implementation detail, we can delete this code.
  • Loading branch information
acdlite authored and nevilm-lt committed Apr 22, 2022
1 parent 59de4c9 commit f51ef7b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 34 deletions.
18 changes: 1 addition & 17 deletions packages/react-reconciler/src/ReactFiberWorkLoop.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,23 +894,7 @@ function recoverFromConcurrentError(root, errorRetryLanes) {
}
}

let exitStatus;

const MAX_ERROR_RETRY_ATTEMPTS = 50;
for (let i = 0; i < MAX_ERROR_RETRY_ATTEMPTS; i++) {
exitStatus = renderRootSync(root, errorRetryLanes);
if (
exitStatus === RootErrored &&
workInProgressRootRenderPhaseUpdatedLanes !== NoLanes
) {
// There was a render phase update during this render. Some internal React
// implementation details may use this as a trick to schedule another
// render pass. To protect against an inifinite loop, eventually
// we'll give up.
continue;
}
break;
}
const exitStatus = renderRootSync(root, errorRetryLanes);

executionContext = prevExecutionContext;

Expand Down
18 changes: 1 addition & 17 deletions packages/react-reconciler/src/ReactFiberWorkLoop.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -894,23 +894,7 @@ function recoverFromConcurrentError(root, errorRetryLanes) {
}
}

let exitStatus;

const MAX_ERROR_RETRY_ATTEMPTS = 50;
for (let i = 0; i < MAX_ERROR_RETRY_ATTEMPTS; i++) {
exitStatus = renderRootSync(root, errorRetryLanes);
if (
exitStatus === RootErrored &&
workInProgressRootRenderPhaseUpdatedLanes !== NoLanes
) {
// There was a render phase update during this render. Some internal React
// implementation details may use this as a trick to schedule another
// render pass. To protect against an inifinite loop, eventually
// we'll give up.
continue;
}
break;
}
const exitStatus = renderRootSync(root, errorRetryLanes);

executionContext = prevExecutionContext;

Expand Down

0 comments on commit f51ef7b

Please sign in to comment.