Skip to content

Commit

Permalink
Wrap in flag to save some bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Apr 28, 2021
1 parent 4c3bdd6 commit 8f1b352
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions packages/react-reconciler/src/ReactFiber.new.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
enableStrictEffects,
enableProfilerTimer,
enableScopeAPI,
enableSyncDefaultUpdates,
} from 'shared/ReactFeatureFlags';
import {NoFlags, Placement, StaticMask} from './ReactFiberFlags';
import {ConcurrentRoot} from './ReactRootTags';
Expand Down Expand Up @@ -442,8 +443,10 @@ export function createHostRootFiber(
mode |= StrictLegacyMode;
}
}
if (concurrentUpdatesByDefaultOverride) {
mode |= ConcurrentUpdatesByDefaultMode;
if (enableSyncDefaultUpdates) {
if (concurrentUpdatesByDefaultOverride) {
mode |= ConcurrentUpdatesByDefaultMode;
}
}
} else {
mode = NoMode;
Expand Down
7 changes: 5 additions & 2 deletions packages/react-reconciler/src/ReactFiber.old.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
enableStrictEffects,
enableProfilerTimer,
enableScopeAPI,
enableSyncDefaultUpdates,
} from 'shared/ReactFeatureFlags';
import {NoFlags, Placement, StaticMask} from './ReactFiberFlags';
import {ConcurrentRoot} from './ReactRootTags';
Expand Down Expand Up @@ -442,8 +443,10 @@ export function createHostRootFiber(
mode |= StrictLegacyMode;
}
}
if (concurrentUpdatesByDefaultOverride) {
mode |= ConcurrentUpdatesByDefaultMode;
if (enableSyncDefaultUpdates) {
if (concurrentUpdatesByDefaultOverride) {
mode |= ConcurrentUpdatesByDefaultMode;
}
}
} else {
mode = NoMode;
Expand Down

0 comments on commit 8f1b352

Please sign in to comment.