Skip to content

Commit 6d2b847

Browse files
committed
[act] Wrap IsThisRendererActing in DEV check
So that it doesn't leak into the production bundle. Follow-up to facebook#16240.
1 parent f440bfd commit 6d2b847

1 file changed

Lines changed: 15 additions & 3 deletions

File tree

packages/react-reconciler/src/ReactFiberWorkLoop.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1034,7 +1034,11 @@ function renderRoot(
10341034
hasNotProcessedNewUpdates &&
10351035
!isSync &&
10361036
// do not delay if we're inside an act() scope
1037-
!(flushSuspenseFallbacksInTests && IsThisRendererActing.current)
1037+
!(
1038+
__DEV__ &&
1039+
flushSuspenseFallbacksInTests &&
1040+
IsThisRendererActing.current
1041+
)
10381042
) {
10391043
// If we have not processed any new updates during this pass, then this is
10401044
// either a retry of an existing fallback state or a hidden tree.
@@ -1075,7 +1079,11 @@ function renderRoot(
10751079
if (
10761080
!isSync &&
10771081
// do not delay if we're inside an act() scope
1078-
!(flushSuspenseFallbacksInTests && IsThisRendererActing.current)
1082+
!(
1083+
__DEV__ &&
1084+
flushSuspenseFallbacksInTests &&
1085+
IsThisRendererActing.current
1086+
)
10791087
) {
10801088
// We're suspended in a state that should be avoided. We'll try to avoid committing
10811089
// it for as long as the timeouts let us.
@@ -1148,7 +1156,11 @@ function renderRoot(
11481156
if (
11491157
!isSync &&
11501158
// do not delay if we're inside an act() scope
1151-
!(flushSuspenseFallbacksInTests && IsThisRendererActing.current) &&
1159+
!(
1160+
__DEV__ &&
1161+
flushSuspenseFallbacksInTests &&
1162+
IsThisRendererActing.current
1163+
) &&
11521164
workInProgressRootLatestProcessedExpirationTime !== Sync &&
11531165
workInProgressRootCanSuspendUsingConfig !== null
11541166
) {

0 commit comments

Comments
 (0)