Remove logic for multiple error recovery attempts (#23227)

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.
This commit is contained in:
Andrew Clark 2022-02-02 13:14:20 -08:00 committed by GitHub
parent 3a44621296
commit 5318971f50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 34 deletions

View File

@ -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;

View File

@ -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;