Skip to content

Commit

Permalink
Remove createRootStrictEffectsByDefault flag
Browse files Browse the repository at this point in the history
  • Loading branch information
rickhanlonii committed Jan 26, 2024
1 parent c7e735f commit b301095
Show file tree
Hide file tree
Showing 12 changed files with 249 additions and 118 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -776,14 +776,7 @@ describe('ReactDOMServerPartialHydration', () => {
const span2 = container.getElementsByTagName('span')[0];
// This is a new node.
expect(span).not.toBe(span2);

if (gate(flags => flags.dfsEffectsRefactor)) {
// The effects list refactor causes this to be null because the Suspense Activity's child
// is null. However, since we can't hydrate Suspense in legacy this change in behavior is ok
expect(ref.current).toBe(null);
} else {
expect(ref.current).toBe(span2);
}
expect(ref.current).toBe(span2);

// Resolving the promise should render the final content.
suspend = false;
Expand Down
3 changes: 1 addition & 2 deletions packages/react-reconciler/src/ReactFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ import {
isHostSingletonType,
} from './ReactFiberConfig';
import {
createRootStrictEffectsByDefault,
enableCache,
enableProfilerTimer,
enableScopeAPI,
Expand Down Expand Up @@ -456,7 +455,7 @@ export function createHostRootFiber(
let mode;
if (tag === ConcurrentRoot) {
mode = ConcurrentMode;
if (isStrictMode === true || createRootStrictEffectsByDefault) {
if (isStrictMode === true) {
mode |= StrictLegacyMode | StrictEffectsMode;
}
if (
Expand Down
Loading

0 comments on commit b301095

Please sign in to comment.