dillon1000/react

Commit

fix: explicitly warn for infinite loops discovered only via enableInfiniteRenderLoopDetection (#36195)

My change in https://github.com/facebook/react/pull/35999 did not cover
all possible scenarios for emitting a warning, instead of throwing.

The instrumentation not only enables the identification for the infinite
loop via execution context checks, but also adds the check to more
lifecycle methods, like `markRootPinged` and `markRootUpdated`.

See the newly added test to understand a potential scenario. Before the
fix, the error would be thrown:
<img width="1192" height="424" alt="Screenshot 2026-04-08 at 17 21 51"
src="https://github.com/user-attachments/assets/ba8ea379-0271-4938-ae45-e37ee75e1963"
/>

With the current changes, the warning is logged with `console.error`.
Browse files
Changed paths3 files
First-parent comparison
M packages/react-dom/src/__tests__/ReactUpdates-test.js ModifiedM packages/react-reconciler/src/ReactFiberConcurrentUpdates.js ModifiedM packages/react-reconciler/src/ReactFiberWorkLoop.js Modified
Patch

Files changed

Rendering syntax-highlighted changes…