Skip to content

Commit fe2b70c

Browse files
committed
[tests] <StrictMode /> nested in tree is broken (facebook#31825)
Adds a test that shows using <StrictMode /> anywhere outside of the root node will not fire strict effects. This works: ```js root.render( <StrictMode> <App> <Children /> </App> </StrictMode> ); ``` This does not fire strict effects on mount: ```js root.render( <App> <StrictMode> <Children /> </StrictMode> </App> ); ``` DiffTrain build for [e1d843f](facebook@e1d843f)
1 parent dcc30de commit fe2b70c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+374
-804
lines changed

compiled/facebook-www/REVISION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6a4b46cd70d2672bc4be59dcb5b8dede22ed0cef
1+
e1d843f4d8776bbf5d4fbd12a39bcfd2c565f900
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6a4b46cd70d2672bc4be59dcb5b8dede22ed0cef
1+
e1d843f4d8776bbf5d4fbd12a39bcfd2c565f900

compiled/facebook-www/React-dev.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ __DEV__ &&
19421942
exports.useTransition = function () {
19431943
return resolveDispatcher().useTransition();
19441944
};
1945-
exports.version = "19.1.0-www-classic-6a4b46cd-20241217";
1945+
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
19461946
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19471947
"function" ===
19481948
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-dev.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1942,7 +1942,7 @@ __DEV__ &&
19421942
exports.useTransition = function () {
19431943
return resolveDispatcher().useTransition();
19441944
};
1945-
exports.version = "19.1.0-www-modern-6a4b46cd-20241217";
1945+
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
19461946
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
19471947
"function" ===
19481948
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-prod.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
630630
exports.useTransition = function () {
631631
return ReactSharedInternals.H.useTransition();
632632
};
633-
exports.version = "19.1.0-www-classic-6a4b46cd-20241217";
633+
exports.version = "19.1.0-www-classic-e1d843f4-20241218";

compiled/facebook-www/React-prod.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
630630
exports.useTransition = function () {
631631
return ReactSharedInternals.H.useTransition();
632632
};
633-
exports.version = "19.1.0-www-modern-6a4b46cd-20241217";
633+
exports.version = "19.1.0-www-modern-e1d843f4-20241218";

compiled/facebook-www/React-profiling.classic.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.1.0-www-classic-6a4b46cd-20241217";
637+
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
638638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
639639
"function" ===
640640
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/React-profiling.modern.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
634634
exports.useTransition = function () {
635635
return ReactSharedInternals.H.useTransition();
636636
};
637-
exports.version = "19.1.0-www-modern-6a4b46cd-20241217";
637+
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
638638
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
639639
"function" ===
640640
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.classic.js

Lines changed: 22 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4598,66 +4598,38 @@ __DEV__ &&
45984598
provider = provider.return;
45994599
}
46004600
}
4601-
function dispatchReducerAction(
4602-
fiber,
4603-
queue,
4604-
action,
4605-
JSCompiler_OptimizeArgumentsArray_p0
4606-
) {
4607-
"function" === typeof JSCompiler_OptimizeArgumentsArray_p0 &&
4601+
function dispatchReducerAction(fiber, queue, action) {
4602+
var args = arguments;
4603+
"function" === typeof args[3] &&
46084604
error$jscomp$0(
46094605
"State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
46104606
);
4611-
JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber);
4612-
action = {
4613-
lane: JSCompiler_OptimizeArgumentsArray_p0,
4607+
args = requestUpdateLane(fiber);
4608+
var update = {
4609+
lane: args,
46144610
revertLane: 0,
46154611
action: action,
46164612
hasEagerState: !1,
46174613
eagerState: null,
46184614
next: null
46194615
};
46204616
isRenderPhaseUpdate(fiber)
4621-
? enqueueRenderPhaseUpdate(queue, action)
4622-
: ((action = enqueueConcurrentHookUpdate(
4623-
fiber,
4624-
queue,
4625-
action,
4626-
JSCompiler_OptimizeArgumentsArray_p0
4627-
)),
4628-
null !== action &&
4629-
(scheduleUpdateOnFiber(
4630-
action,
4631-
fiber,
4632-
JSCompiler_OptimizeArgumentsArray_p0
4633-
),
4634-
entangleTransitionUpdate(
4635-
action,
4636-
queue,
4637-
JSCompiler_OptimizeArgumentsArray_p0
4638-
)));
4639-
enableSchedulingProfiler &&
4640-
markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0);
4641-
}
4642-
function dispatchSetState(
4643-
fiber,
4644-
queue,
4645-
action,
4646-
JSCompiler_OptimizeArgumentsArray_p1
4647-
) {
4648-
"function" === typeof JSCompiler_OptimizeArgumentsArray_p1 &&
4617+
? enqueueRenderPhaseUpdate(queue, update)
4618+
: ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)),
4619+
null !== update &&
4620+
(scheduleUpdateOnFiber(update, fiber, args),
4621+
entangleTransitionUpdate(update, queue, args)));
4622+
enableSchedulingProfiler && markStateUpdateScheduled(fiber, args);
4623+
}
4624+
function dispatchSetState(fiber, queue, action) {
4625+
var args = arguments;
4626+
"function" === typeof args[3] &&
46494627
error$jscomp$0(
46504628
"State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
46514629
);
4652-
JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber);
4653-
dispatchSetStateInternal(
4654-
fiber,
4655-
queue,
4656-
action,
4657-
JSCompiler_OptimizeArgumentsArray_p1
4658-
);
4659-
enableSchedulingProfiler &&
4660-
markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1);
4630+
args = requestUpdateLane(fiber);
4631+
dispatchSetStateInternal(fiber, queue, action, args);
4632+
enableSchedulingProfiler && markStateUpdateScheduled(fiber, args);
46614633
}
46624634
function dispatchSetStateInternal(fiber, queue, action, lane) {
46634635
var update = {
@@ -16898,10 +16870,10 @@ __DEV__ &&
1689816870
(function () {
1689916871
var internals = {
1690016872
bundleType: 1,
16901-
version: "19.1.0-www-classic-6a4b46cd-20241217",
16873+
version: "19.1.0-www-classic-e1d843f4-20241218",
1690216874
rendererPackageName: "react-art",
1690316875
currentDispatcherRef: ReactSharedInternals,
16904-
reconcilerVersion: "19.1.0-www-classic-6a4b46cd-20241217"
16876+
reconcilerVersion: "19.1.0-www-classic-e1d843f4-20241218"
1690516877
};
1690616878
internals.overrideHookState = overrideHookState;
1690716879
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16935,7 +16907,7 @@ __DEV__ &&
1693516907
exports.Shape = Shape;
1693616908
exports.Surface = Surface;
1693716909
exports.Text = Text;
16938-
exports.version = "19.1.0-www-classic-6a4b46cd-20241217";
16910+
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
1693916911
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1694016912
"function" ===
1694116913
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

compiled/facebook-www/ReactART-dev.modern.js

Lines changed: 22 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -4490,66 +4490,38 @@ __DEV__ &&
44904490
provider = provider.return;
44914491
}
44924492
}
4493-
function dispatchReducerAction(
4494-
fiber,
4495-
queue,
4496-
action,
4497-
JSCompiler_OptimizeArgumentsArray_p0
4498-
) {
4499-
"function" === typeof JSCompiler_OptimizeArgumentsArray_p0 &&
4493+
function dispatchReducerAction(fiber, queue, action) {
4494+
var args = arguments;
4495+
"function" === typeof args[3] &&
45004496
error$jscomp$0(
45014497
"State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
45024498
);
4503-
JSCompiler_OptimizeArgumentsArray_p0 = requestUpdateLane(fiber);
4504-
action = {
4505-
lane: JSCompiler_OptimizeArgumentsArray_p0,
4499+
args = requestUpdateLane(fiber);
4500+
var update = {
4501+
lane: args,
45064502
revertLane: 0,
45074503
action: action,
45084504
hasEagerState: !1,
45094505
eagerState: null,
45104506
next: null
45114507
};
45124508
isRenderPhaseUpdate(fiber)
4513-
? enqueueRenderPhaseUpdate(queue, action)
4514-
: ((action = enqueueConcurrentHookUpdate(
4515-
fiber,
4516-
queue,
4517-
action,
4518-
JSCompiler_OptimizeArgumentsArray_p0
4519-
)),
4520-
null !== action &&
4521-
(scheduleUpdateOnFiber(
4522-
action,
4523-
fiber,
4524-
JSCompiler_OptimizeArgumentsArray_p0
4525-
),
4526-
entangleTransitionUpdate(
4527-
action,
4528-
queue,
4529-
JSCompiler_OptimizeArgumentsArray_p0
4530-
)));
4531-
enableSchedulingProfiler &&
4532-
markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p0);
4533-
}
4534-
function dispatchSetState(
4535-
fiber,
4536-
queue,
4537-
action,
4538-
JSCompiler_OptimizeArgumentsArray_p1
4539-
) {
4540-
"function" === typeof JSCompiler_OptimizeArgumentsArray_p1 &&
4509+
? enqueueRenderPhaseUpdate(queue, update)
4510+
: ((update = enqueueConcurrentHookUpdate(fiber, queue, update, args)),
4511+
null !== update &&
4512+
(scheduleUpdateOnFiber(update, fiber, args),
4513+
entangleTransitionUpdate(update, queue, args)));
4514+
enableSchedulingProfiler && markStateUpdateScheduled(fiber, args);
4515+
}
4516+
function dispatchSetState(fiber, queue, action) {
4517+
var args = arguments;
4518+
"function" === typeof args[3] &&
45414519
error$jscomp$0(
45424520
"State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."
45434521
);
4544-
JSCompiler_OptimizeArgumentsArray_p1 = requestUpdateLane(fiber);
4545-
dispatchSetStateInternal(
4546-
fiber,
4547-
queue,
4548-
action,
4549-
JSCompiler_OptimizeArgumentsArray_p1
4550-
);
4551-
enableSchedulingProfiler &&
4552-
markStateUpdateScheduled(fiber, JSCompiler_OptimizeArgumentsArray_p1);
4522+
args = requestUpdateLane(fiber);
4523+
dispatchSetStateInternal(fiber, queue, action, args);
4524+
enableSchedulingProfiler && markStateUpdateScheduled(fiber, args);
45534525
}
45544526
function dispatchSetStateInternal(fiber, queue, action, lane) {
45554527
var update = {
@@ -16661,10 +16633,10 @@ __DEV__ &&
1666116633
(function () {
1666216634
var internals = {
1666316635
bundleType: 1,
16664-
version: "19.1.0-www-modern-6a4b46cd-20241217",
16636+
version: "19.1.0-www-modern-e1d843f4-20241218",
1666516637
rendererPackageName: "react-art",
1666616638
currentDispatcherRef: ReactSharedInternals,
16667-
reconcilerVersion: "19.1.0-www-modern-6a4b46cd-20241217"
16639+
reconcilerVersion: "19.1.0-www-modern-e1d843f4-20241218"
1666816640
};
1666916641
internals.overrideHookState = overrideHookState;
1667016642
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
@@ -16698,7 +16670,7 @@ __DEV__ &&
1669816670
exports.Shape = Shape;
1669916671
exports.Surface = Surface;
1670016672
exports.Text = Text;
16701-
exports.version = "19.1.0-www-modern-6a4b46cd-20241217";
16673+
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
1670216674
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
1670316675
"function" ===
1670416676
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&

0 commit comments

Comments
 (0)