Skip to content

Commit

Permalink
[tests] <StrictMode /> nested in tree is broken (#31825)
Browse files Browse the repository at this point in the history
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](e1d843f)
  • Loading branch information
rickhanlonii committed Dec 18, 2024
1 parent 9c3a23a commit ae1889e
Show file tree
Hide file tree
Showing 32 changed files with 84 additions and 84 deletions.
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@ __DEV__ &&
exports.useTransition = function () {
return resolveDispatcher().useTransition();
};
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -630,4 +630,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/React-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactSharedInternals.H.useTransition();
};
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -16870,10 +16870,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-1e9ef39a-20241218",
version: "19.1.0-www-classic-e1d843f4-20241218",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-classic-e1d843f4-20241218"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16907,7 +16907,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16633,10 +16633,10 @@ __DEV__ &&
(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-1e9ef39a-20241218",
version: "19.1.0-www-modern-e1d843f4-20241218",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-modern-e1d843f4-20241218"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -16670,7 +16670,7 @@ __DEV__ &&
exports.Shape = Shape;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -10757,10 +10757,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1495 = {
bundleType: 0,
version: "19.1.0-www-classic-1e9ef39a-20241218",
version: "19.1.0-www-classic-e1d843f4-20241218",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-classic-e1d843f4-20241218"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1496 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10786,4 +10786,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
6 changes: 3 additions & 3 deletions compiled/facebook-www/ReactART-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -10473,10 +10473,10 @@ var slice = Array.prototype.slice,
})(React.Component);
var internals$jscomp$inline_1474 = {
bundleType: 0,
version: "19.1.0-www-modern-1e9ef39a-20241218",
version: "19.1.0-www-modern-e1d843f4-20241218",
rendererPackageName: "react-art",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-modern-e1d843f4-20241218"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1475 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand All @@ -10502,4 +10502,4 @@ exports.RadialGradient = RadialGradient;
exports.Shape = TYPES.SHAPE;
exports.Surface = Surface;
exports.Text = Text;
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -27345,11 +27345,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-classic-1e9ef39a-20241218" !== isomorphicReactPackageVersion)
if ("19.1.0-www-classic-e1d843f4-20241218" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-www-classic-1e9ef39a-20241218\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-classic-e1d843f4-20241218\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27392,10 +27392,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-classic-1e9ef39a-20241218",
version: "19.1.0-www-classic-e1d843f4-20241218",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-classic-e1d843f4-20241218"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -27993,7 +27993,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -27124,11 +27124,11 @@ __DEV__ &&
return_targetInst = null;
(function () {
var isomorphicReactPackageVersion = React.version;
if ("19.1.0-www-modern-1e9ef39a-20241218" !== isomorphicReactPackageVersion)
if ("19.1.0-www-modern-e1d843f4-20241218" !== isomorphicReactPackageVersion)
throw Error(
'Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:\n - react: ' +
(isomorphicReactPackageVersion +
"\n - react-dom: 19.1.0-www-modern-1e9ef39a-20241218\nLearn more: https://react.dev/warnings/version-mismatch")
"\n - react-dom: 19.1.0-www-modern-e1d843f4-20241218\nLearn more: https://react.dev/warnings/version-mismatch")
);
})();
("function" === typeof Map &&
Expand Down Expand Up @@ -27171,10 +27171,10 @@ __DEV__ &&
!(function () {
var internals = {
bundleType: 1,
version: "19.1.0-www-modern-1e9ef39a-20241218",
version: "19.1.0-www-modern-e1d843f4-20241218",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-modern-e1d843f4-20241218"
};
internals.overrideHookState = overrideHookState;
internals.overrideHookStateDeletePath = overrideHookStateDeletePath;
Expand Down Expand Up @@ -27772,7 +27772,7 @@ __DEV__ &&
exports.useFormStatus = function () {
return resolveDispatcher().useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17221,14 +17221,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1767 = React.version;
if (
"19.1.0-www-classic-1e9ef39a-20241218" !==
"19.1.0-www-classic-e1d843f4-20241218" !==
isomorphicReactPackageVersion$jscomp$inline_1767
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1767,
"19.1.0-www-classic-1e9ef39a-20241218"
"19.1.0-www-classic-e1d843f4-20241218"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -17246,10 +17246,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2301 = {
bundleType: 0,
version: "19.1.0-www-classic-1e9ef39a-20241218",
version: "19.1.0-www-classic-e1d843f4-20241218",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-classic-e1d843f4-20241218"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2302 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17614,4 +17614,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -16952,14 +16952,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1757 = React.version;
if (
"19.1.0-www-modern-1e9ef39a-20241218" !==
"19.1.0-www-modern-e1d843f4-20241218" !==
isomorphicReactPackageVersion$jscomp$inline_1757
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1757,
"19.1.0-www-modern-1e9ef39a-20241218"
"19.1.0-www-modern-e1d843f4-20241218"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -16977,10 +16977,10 @@ Internals.Events = [
];
var internals$jscomp$inline_2283 = {
bundleType: 0,
version: "19.1.0-www-modern-1e9ef39a-20241218",
version: "19.1.0-www-modern-e1d843f4-20241218",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-modern-e1d843f4-20241218"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_2284 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
Expand Down Expand Up @@ -17345,4 +17345,4 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -17910,14 +17910,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1860 = React.version;
if (
"19.1.0-www-classic-1e9ef39a-20241218" !==
"19.1.0-www-classic-e1d843f4-20241218" !==
isomorphicReactPackageVersion$jscomp$inline_1860
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1860,
"19.1.0-www-classic-1e9ef39a-20241218"
"19.1.0-www-classic-e1d843f4-20241218"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -17935,10 +17935,10 @@ Internals.Events = [
];
var internals$jscomp$inline_1862 = {
bundleType: 0,
version: "19.1.0-www-classic-1e9ef39a-20241218",
version: "19.1.0-www-classic-e1d843f4-20241218",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-classic-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-classic-e1d843f4-20241218"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_1862.getLaneLabelMap = getLaneLabelMap),
Expand Down Expand Up @@ -18306,7 +18306,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
10 changes: 5 additions & 5 deletions compiled/facebook-www/ReactDOM-profiling.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -17640,14 +17640,14 @@ function getCrossOriginStringAs(as, input) {
}
var isomorphicReactPackageVersion$jscomp$inline_1850 = React.version;
if (
"19.1.0-www-modern-1e9ef39a-20241218" !==
"19.1.0-www-modern-e1d843f4-20241218" !==
isomorphicReactPackageVersion$jscomp$inline_1850
)
throw Error(
formatProdErrorMessage(
527,
isomorphicReactPackageVersion$jscomp$inline_1850,
"19.1.0-www-modern-1e9ef39a-20241218"
"19.1.0-www-modern-e1d843f4-20241218"
)
);
Internals.findDOMNode = function (componentOrElement) {
Expand All @@ -17665,10 +17665,10 @@ Internals.Events = [
];
var internals$jscomp$inline_1852 = {
bundleType: 0,
version: "19.1.0-www-modern-1e9ef39a-20241218",
version: "19.1.0-www-modern-e1d843f4-20241218",
rendererPackageName: "react-dom",
currentDispatcherRef: ReactSharedInternals,
reconcilerVersion: "19.1.0-www-modern-1e9ef39a-20241218"
reconcilerVersion: "19.1.0-www-modern-e1d843f4-20241218"
};
enableSchedulingProfiler &&
((internals$jscomp$inline_1852.getLaneLabelMap = getLaneLabelMap),
Expand Down Expand Up @@ -18036,7 +18036,7 @@ exports.useFormState = function (action, initialState, permalink) {
exports.useFormStatus = function () {
return ReactSharedInternals.H.useHostTransitionStatus();
};
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
Expand Down
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-dev.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -9150,5 +9150,5 @@ __DEV__ &&
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
})();
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-dev.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -8976,5 +8976,5 @@ __DEV__ &&
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
})();
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-prod.classic.js
Original file line number Diff line number Diff line change
Expand Up @@ -5898,4 +5898,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-classic-1e9ef39a-20241218";
exports.version = "19.1.0-www-classic-e1d843f4-20241218";
2 changes: 1 addition & 1 deletion compiled/facebook-www/ReactDOMServer-prod.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -5810,4 +5810,4 @@ exports.renderToString = function (children, options) {
'The server used "renderToString" which does not support Suspense. If you intended for this Suspense boundary to render the fallback content on the server consider throwing an Error somewhere within the Suspense boundary. If you intended to have the server wait for the suspended component please switch to "renderToReadableStream" which supports Suspense on the server'
);
};
exports.version = "19.1.0-www-modern-1e9ef39a-20241218";
exports.version = "19.1.0-www-modern-e1d843f4-20241218";
Loading

0 comments on commit ae1889e

Please sign in to comment.