@samitouri / QOS-React-2 / commits / 5318971f50

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.

Andrew Clark committed Feb 2, 2022 at 13:14 UTC 5318971f50da06fd42763689826acecdb14b4c5e
2 files changed +2 -34
packages/react-reconciler/src/ReactFiberWorkLoop.new.js
+1 -17
@@ -894,23 +894,7 @@ function recoverFromConcurrentError(root, errorRetryLanes) {
894 }
895 }
896
897 - let exitStatus;
898 -
899 - const MAX_ERROR_RETRY_ATTEMPTS = 50;
900 - for (let i = 0; i < MAX_ERROR_RETRY_ATTEMPTS; i++) {
901 - exitStatus = renderRootSync(root, errorRetryLanes);
902 - if (
903 - exitStatus === RootErrored &&
904 - workInProgressRootRenderPhaseUpdatedLanes !== NoLanes
905 - ) {
906 - // There was a render phase update during this render. Some internal React
907 - // implementation details may use this as a trick to schedule another
908 - // render pass. To protect against an inifinite loop, eventually
909 - // we'll give up.
910 - continue;
911 - }
912 - break;
913 - }
897 + const exitStatus = renderRootSync(root, errorRetryLanes);
898
899 executionContext = prevExecutionContext;
900
packages/react-reconciler/src/ReactFiberWorkLoop.old.js
+1 -17
@@ -894,23 +894,7 @@ function recoverFromConcurrentError(root, errorRetryLanes) {
894 }
895 }
896
897 - let exitStatus;
898 -
899 - const MAX_ERROR_RETRY_ATTEMPTS = 50;
900 - for (let i = 0; i < MAX_ERROR_RETRY_ATTEMPTS; i++) {
901 - exitStatus = renderRootSync(root, errorRetryLanes);
902 - if (
903 - exitStatus === RootErrored &&
904 - workInProgressRootRenderPhaseUpdatedLanes !== NoLanes
905 - ) {
906 - // There was a render phase update during this render. Some internal React
907 - // implementation details may use this as a trick to schedule another
908 - // render pass. To protect against an inifinite loop, eventually
909 - // we'll give up.
910 - continue;
911 - }
912 - break;
913 - }
897 + const exitStatus = renderRootSync(root, errorRetryLanes);
898
899 executionContext = prevExecutionContext;
900