Skip to content

Commit

Permalink
[act] Wrap IsThisRendererActing in DEV check
Browse files Browse the repository at this point in the history
So that it doesn't leak into the production bundle. Follow-up to facebook#16240.
  • Loading branch information
acdlite committed Jul 31, 2019
1 parent f440bfd commit 6d2b847
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions packages/react-reconciler/src/ReactFiberWorkLoop.js
Original file line number Diff line number Diff line change
Expand Up @@ -1034,7 +1034,11 @@ function renderRoot(
hasNotProcessedNewUpdates &&
!isSync &&
// do not delay if we're inside an act() scope
!(flushSuspenseFallbacksInTests && IsThisRendererActing.current)
!(
__DEV__ &&
flushSuspenseFallbacksInTests &&
IsThisRendererActing.current
)
) {
// If we have not processed any new updates during this pass, then this is
// either a retry of an existing fallback state or a hidden tree.
Expand Down Expand Up @@ -1075,7 +1079,11 @@ function renderRoot(
if (
!isSync &&
// do not delay if we're inside an act() scope
!(flushSuspenseFallbacksInTests && IsThisRendererActing.current)
!(
__DEV__ &&
flushSuspenseFallbacksInTests &&
IsThisRendererActing.current
)
) {
// We're suspended in a state that should be avoided. We'll try to avoid committing
// it for as long as the timeouts let us.
Expand Down Expand Up @@ -1148,7 +1156,11 @@ function renderRoot(
if (
!isSync &&
// do not delay if we're inside an act() scope
!(flushSuspenseFallbacksInTests && IsThisRendererActing.current) &&
!(
__DEV__ &&
flushSuspenseFallbacksInTests &&
IsThisRendererActing.current
) &&
workInProgressRootLatestProcessedExpirationTime !== Sync &&
workInProgressRootCanSuspendUsingConfig !== null
) {
Expand Down

0 comments on commit 6d2b847

Please sign in to comment.