Update useMemoCache test to confirm that cache persists across errors (#26510)

## Summary

Updates the `useMemoCache()` tests to validate that the memo cache
persists when a component does a setState during render or throws during
render. Forget's compilation output follows the general pattern used in
this test and is resilient to rendering running partway and then again
with different inputs.

## How did you test this change?

`yarn test` (this is a test-only change)

DiffTrain build for commit https://github.com/facebook/react/commit/0ffc7f632b5cdc2d4ede97b6f8ff55e02183bdf9.
This commit is contained in:
josephsavona
2023-03-30 14:52:13 +00:00
parent 2794aba78d
commit f115265695
13 changed files with 19 additions and 19 deletions
@@ -23762,7 +23762,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-next-29a3be78b-20230329";
var ReactVersion = "18.3.0-next-0ffc7f632-20230330";
// Might add PROFILE later.
@@ -8640,7 +8640,7 @@ var devToolsConfig$jscomp$inline_1007 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-29a3be78b-20230329",
version: "18.3.0-next-0ffc7f632-20230330",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1198 = {
@@ -8671,7 +8671,7 @@ var internals$jscomp$inline_1198 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-29a3be78b-20230329"
reconcilerVersion: "18.3.0-next-0ffc7f632-20230330"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1199 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9065,7 +9065,7 @@ var devToolsConfig$jscomp$inline_1050 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-next-29a3be78b-20230329",
version: "18.3.0-next-0ffc7f632-20230330",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1239 = {
@@ -9096,7 +9096,7 @@ var internals$jscomp$inline_1239 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-29a3be78b-20230329"
reconcilerVersion: "18.3.0-next-0ffc7f632-20230330"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1240 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -27,7 +27,7 @@ if (
}
"use strict";
var ReactVersion = "18.3.0-next-29a3be78b-20230329";
var ReactVersion = "18.3.0-next-0ffc7f632-20230330";
// ATTENTION
// When adding new symbols to this file,
@@ -639,4 +639,4 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-29a3be78b-20230329";
exports.version = "18.3.0-next-0ffc7f632-20230330";
@@ -642,7 +642,7 @@ exports.useSyncExternalStore = function (
);
};
exports.useTransition = useTransition;
exports.version = "18.3.0-next-29a3be78b-20230329";
exports.version = "18.3.0-next-0ffc7f632-20230330";
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */
if (
@@ -1 +1 @@
29a3be78bd80372f882ce9d39b12241a97c3d268
0ffc7f632b5cdc2d4ede97b6f8ff55e02183bdf9
@@ -27028,7 +27028,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-next-29a3be78b-20230329";
var ReactVersion = "18.3.0-next-0ffc7f632-20230330";
function createPortal$1(
children,
@@ -9507,7 +9507,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1027 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-29a3be78b-20230329",
version: "18.3.0-next-0ffc7f632-20230330",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -9549,7 +9549,7 @@ var internals$jscomp$inline_1273 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-29a3be78b-20230329"
reconcilerVersion: "18.3.0-next-0ffc7f632-20230330"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1274 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10215,7 +10215,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1106 = {
findFiberByHostInstance: getInstanceFromNode,
bundleType: 0,
version: "18.3.0-next-29a3be78b-20230329",
version: "18.3.0-next-0ffc7f632-20230330",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -10270,7 +10270,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-29a3be78b-20230329"
reconcilerVersion: "18.3.0-next-0ffc7f632-20230330"
});
exports.createPortal = function (children, containerTag) {
return createPortal$1(
@@ -27568,7 +27568,7 @@ function createFiberRoot(
return root;
}
var ReactVersion = "18.3.0-next-29a3be78b-20230329";
var ReactVersion = "18.3.0-next-0ffc7f632-20230330";
function createPortal$1(
children,
@@ -9763,7 +9763,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1086 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-29a3be78b-20230329",
version: "18.3.0-next-0ffc7f632-20230330",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -9805,7 +9805,7 @@ var internals$jscomp$inline_1339 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-29a3be78b-20230329"
reconcilerVersion: "18.3.0-next-0ffc7f632-20230330"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1340 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -10471,7 +10471,7 @@ var roots = new Map(),
devToolsConfig$jscomp$inline_1165 = {
findFiberByHostInstance: getInstanceFromTag,
bundleType: 0,
version: "18.3.0-next-29a3be78b-20230329",
version: "18.3.0-next-0ffc7f632-20230330",
rendererPackageName: "react-native-renderer",
rendererConfig: {
getInspectorDataForViewTag: function () {
@@ -10526,7 +10526,7 @@ var roots = new Map(),
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-next-29a3be78b-20230329"
reconcilerVersion: "18.3.0-next-0ffc7f632-20230330"
});
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = {
computeComponentStackForErrorReporting: function (reactTag) {