@samitouri / QOS-React / commits / f9ebd85a19

Increase nested update limit to 100 (#31061)

We're seeing the limit hit in some tests after enabling sibling prerendering. Let's bump the limit so we can run more tests and gather more signal on the changes. When we understand the scope of the problem we can determine whether we need to change how the updates are counted in prerenders and/or fix specific areas of product code.

Jack Pope committed Sep 25, 2024 at 11:50 UTC f9ebd85a196948be17efdd6774b4d0464b3b1f53
3 files changed +4 -4
packages/react-dom/src/__tests__/ReactLegacyUpdates-test.js
+1 -1
@@ -1427,7 +1427,7 @@ describe('ReactLegacyUpdates', () => {
1427 }
1428 }
1429
1430 - let limit = 55;
1430 + let limit = 105;
1431 await expect(async () => {
1432 await act(() => {
1433 ReactDOM.render(<EventuallyTerminating ref={ref} />, container);
packages/react-dom/src/__tests__/ReactUpdates-test.js
+1 -1
@@ -1542,7 +1542,7 @@ describe('ReactUpdates', () => {
1542 }
1543 }
1544
1545 - let limit = 55;
1545 + let limit = 105;
1546 const root = ReactDOMClient.createRoot(container);
1547 await expect(async () => {
1548 await act(() => {
packages/react-reconciler/src/ReactFiberWorkLoop.js
+2 -2
@@ -613,13 +613,13 @@ let pendingPassiveEffectsRenderEndTime: number = -0; // Profiling-only
613 let pendingPassiveTransitions: Array<Transition> | null = null;
614
615 // Use these to prevent an infinite loop of nested updates
616 -const NESTED_UPDATE_LIMIT = 50;
616 +const NESTED_UPDATE_LIMIT = 100;
617 let nestedUpdateCount: number = 0;
618 let rootWithNestedUpdates: FiberRoot | null = null;
619 let isFlushingPassiveEffects = false;
620 let didScheduleUpdateDuringPassiveEffects = false;
621
622 -const NESTED_PASSIVE_UPDATE_LIMIT = 50;
622 +const NESTED_PASSIVE_UPDATE_LIMIT = 100;
623 let nestedPassiveUpdateCount: number = 0;
624 let rootWithPassiveNestedUpdates: FiberRoot | null = null;
625