@@ -1754,7 +1754,7 @@ function markRootUpdated(root: FiberRoot, updatedLanes: Lanes) {
17541754 didIncludeCommitPhaseUpdate = true ;
17551755 }
17561756
1757- throwIfInfiniteUpdateLoopDetected ( ) ;
1757+ throwIfInfiniteUpdateLoopDetected ( true ) ;
17581758 }
17591759}
17601760
@@ -1773,7 +1773,7 @@ function markRootPinged(root: FiberRoot, pingedLanes: Lanes) {
17731773 didIncludeCommitPhaseUpdate = true ;
17741774 }
17751775
1776- throwIfInfiniteUpdateLoopDetected ( ) ;
1776+ throwIfInfiniteUpdateLoopDetected ( true ) ;
17771777 }
17781778}
17791779
@@ -5175,7 +5175,9 @@ export function resolveRetryWakeable(boundaryFiber: Fiber, wakeable: Wakeable) {
51755175 retryTimedOutBoundary ( boundaryFiber , retryLane ) ;
51765176}
51775177
5178- export function throwIfInfiniteUpdateLoopDetected ( ) {
5178+ export function throwIfInfiniteUpdateLoopDetected (
5179+ isFromInfiniteRenderLoopDetectionInstrumentation : boolean ,
5180+ ) {
51795181 if ( nestedUpdateCount > NESTED_UPDATE_LIMIT ) {
51805182 nestedUpdateCount = 0 ;
51815183 nestedPassiveUpdateCount = 0 ;
@@ -5187,7 +5189,10 @@ export function throwIfInfiniteUpdateLoopDetected() {
51875189
51885190 if ( enableInfiniteRenderLoopDetection ) {
51895191 if ( updateKind === NESTED_UPDATE_SYNC_LANE ) {
5190- if ( executionContext & RenderContext && workInProgressRoot !== null ) {
5192+ if (
5193+ isFromInfiniteRenderLoopDetectionInstrumentation ||
5194+ ( executionContext & RenderContext && workInProgressRoot !== null )
5195+ ) {
51915196 // This loop was identified only because of the instrumentation gated with enableInfiniteRenderLoopDetection, warn instead of throwing.
51925197 if ( __DEV__ ) {
51935198 console . error (
0 commit comments