@@ -74,9 +74,9 @@ import ReactStrictModeWarnings from './ReactStrictModeWarnings';
7474import { refineResolvedLazyComponent } from 'shared/ReactLazyComponent' ;
7575import { REACT_LAZY_TYPE , getIteratorFn } from 'shared/ReactSymbols' ;
7676import {
77- setCurrentPhase ,
7877 getCurrentFiberOwnerNameInDevOrNull ,
7978 getCurrentFiberStackInDev ,
79+ setIsRendering ,
8080} from './ReactCurrentFiber' ;
8181import { startWorkTimer , cancelWorkTimer } from './ReactDebugFiberPerf' ;
8282import {
@@ -193,7 +193,6 @@ let didWarnAboutContextTypeOnFunctionComponent;
193193let didWarnAboutGetDerivedStateOnFunctionComponent ;
194194let didWarnAboutFunctionRefs ;
195195export let didWarnAboutReassigningProps ;
196- let didWarnAboutMaxDuration ;
197196let didWarnAboutRevealOrder ;
198197let didWarnAboutTailOptions ;
199198let didWarnAboutDefaultPropsOnFunctionComponent ;
@@ -205,7 +204,6 @@ if (__DEV__) {
205204 didWarnAboutGetDerivedStateOnFunctionComponent = { } ;
206205 didWarnAboutFunctionRefs = { } ;
207206 didWarnAboutReassigningProps = false ;
208- didWarnAboutMaxDuration = false ;
209207 didWarnAboutRevealOrder = { } ;
210208 didWarnAboutTailOptions = { } ;
211209 didWarnAboutDefaultPropsOnFunctionComponent = { } ;
@@ -312,7 +310,7 @@ function updateForwardRef(
312310 prepareToReadContext ( workInProgress , renderExpirationTime ) ;
313311 if ( __DEV__ ) {
314312 ReactCurrentOwner . current = workInProgress ;
315- setCurrentPhase ( 'render' ) ;
313+ setIsRendering ( true ) ;
316314 nextChildren = renderWithHooks (
317315 current ,
318316 workInProgress ,
@@ -337,7 +335,7 @@ function updateForwardRef(
337335 ) ;
338336 }
339337 }
340- setCurrentPhase ( null ) ;
338+ setIsRendering ( false ) ;
341339 } else {
342340 nextChildren = renderWithHooks (
343341 current ,
@@ -644,7 +642,7 @@ function updateFunctionComponent(
644642 prepareToReadContext ( workInProgress , renderExpirationTime ) ;
645643 if ( __DEV__ ) {
646644 ReactCurrentOwner . current = workInProgress ;
647- setCurrentPhase ( 'render' ) ;
645+ setIsRendering ( true ) ;
648646 nextChildren = renderWithHooks (
649647 current ,
650648 workInProgress ,
@@ -669,7 +667,7 @@ function updateFunctionComponent(
669667 ) ;
670668 }
671669 }
672- setCurrentPhase ( null ) ;
670+ setIsRendering ( false ) ;
673671 } else {
674672 nextChildren = renderWithHooks (
675673 current ,
@@ -720,7 +718,7 @@ function updateBlock(
720718 prepareToReadContext ( workInProgress , renderExpirationTime ) ;
721719 if ( __DEV__ ) {
722720 ReactCurrentOwner . current = workInProgress ;
723- setCurrentPhase ( 'render' ) ;
721+ setIsRendering ( true ) ;
724722 nextChildren = renderWithHooks (
725723 current ,
726724 workInProgress ,
@@ -745,7 +743,7 @@ function updateBlock(
745743 ) ;
746744 }
747745 }
748- setCurrentPhase ( null ) ;
746+ setIsRendering ( false ) ;
749747 } else {
750748 nextChildren = renderWithHooks (
751749 current ,
@@ -923,15 +921,15 @@ function finishClassComponent(
923921 }
924922 } else {
925923 if ( __DEV__ ) {
926- setCurrentPhase ( 'render' ) ;
924+ setIsRendering ( true ) ;
927925 nextChildren = instance . render ( ) ;
928926 if (
929927 debugRenderPhaseSideEffectsForStrictMode &&
930928 workInProgress . mode & StrictMode
931929 ) {
932930 instance . render ( ) ;
933931 }
934- setCurrentPhase ( null ) ;
932+ setIsRendering ( false ) ;
935933 } else {
936934 nextChildren = instance . render ( ) ;
937935 }
@@ -1637,18 +1635,6 @@ function updateSuspenseComponent(
16371635
16381636 pushSuspenseContext ( workInProgress , suspenseContext ) ;
16391637
1640- if ( __DEV__ ) {
1641- if ( 'maxDuration' in nextProps ) {
1642- if ( ! didWarnAboutMaxDuration ) {
1643- didWarnAboutMaxDuration = true ;
1644- console . error (
1645- 'maxDuration has been removed from React. ' +
1646- 'Remove the maxDuration prop.' ,
1647- ) ;
1648- }
1649- }
1650- }
1651-
16521638 // This next part is a bit confusing. If the children timeout, we switch to
16531639 // showing the fallback children in place of the "primary" children.
16541640 // However, we don't want to delete the primary children because then their
@@ -2732,9 +2718,9 @@ function updateContextConsumer(
27322718 let newChildren ;
27332719 if ( __DEV__ ) {
27342720 ReactCurrentOwner . current = workInProgress ;
2735- setCurrentPhase ( 'render' ) ;
2721+ setIsRendering ( true ) ;
27362722 newChildren = render ( newValue ) ;
2737- setCurrentPhase ( null ) ;
2723+ setIsRendering ( false ) ;
27382724 } else {
27392725 newChildren = render ( newValue ) ;
27402726 }
0 commit comments