Skip to content

Commit f9ebd85

Browse files
authored
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.
1 parent d2e9b9b commit f9ebd85

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

packages/react-dom/src/__tests__/ReactLegacyUpdates-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,7 @@ describe('ReactLegacyUpdates', () => {
14271427
}
14281428
}
14291429

1430-
let limit = 55;
1430+
let limit = 105;
14311431
await expect(async () => {
14321432
await act(() => {
14331433
ReactDOM.render(<EventuallyTerminating ref={ref} />, container);

packages/react-dom/src/__tests__/ReactUpdates-test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ describe('ReactUpdates', () => {
15421542
}
15431543
}
15441544

1545-
let limit = 55;
1545+
let limit = 105;
15461546
const root = ReactDOMClient.createRoot(container);
15471547
await expect(async () => {
15481548
await act(() => {

packages/react-reconciler/src/ReactFiberWorkLoop.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -613,13 +613,13 @@ let pendingPassiveEffectsRenderEndTime: number = -0; // Profiling-only
613613
let pendingPassiveTransitions: Array<Transition> | null = null;
614614

615615
// Use these to prevent an infinite loop of nested updates
616-
const NESTED_UPDATE_LIMIT = 50;
616+
const NESTED_UPDATE_LIMIT = 100;
617617
let nestedUpdateCount: number = 0;
618618
let rootWithNestedUpdates: FiberRoot | null = null;
619619
let isFlushingPassiveEffects = false;
620620
let didScheduleUpdateDuringPassiveEffects = false;
621621

622-
const NESTED_PASSIVE_UPDATE_LIMIT = 50;
622+
const NESTED_PASSIVE_UPDATE_LIMIT = 100;
623623
let nestedPassiveUpdateCount: number = 0;
624624
let rootWithPassiveNestedUpdates: FiberRoot | null = null;
625625

0 commit comments

Comments
 (0)