DevTools: Add support for useOptimistic Hook (#27982)

## Summary

Add support for `useOptimistic` Hook fixing "Unsupported hook in the
react-debug-tools package: Missing method in Dispatcher: useOptimistic"
when inspecting components using `useOptimistic`

## How did you test this change?

- Added test following the same pattern as for `useDeferredValue`

DiffTrain build for commit https://github.com/facebook/react/commit/85cc01743bc992a689770a4f37e3d5441f14f082.
This commit is contained in:
eps1lon
2024-02-02 22:22:58 +00:00
parent 1bdb35f1b3
commit 0ad20625c1
7 changed files with 9 additions and 9 deletions
@@ -25622,7 +25622,7 @@ if (__DEV__) {
return root;
}
var ReactVersion = "18.3.0-canary-00f9acb12-20240202";
var ReactVersion = "18.3.0-canary-85cc01743-20240202";
// Might add PROFILE later.
@@ -9171,7 +9171,7 @@ var devToolsConfig$jscomp$inline_1012 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-00f9acb12-20240202",
version: "18.3.0-canary-85cc01743-20240202",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1190 = {
@@ -9202,7 +9202,7 @@ var internals$jscomp$inline_1190 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-00f9acb12-20240202"
reconcilerVersion: "18.3.0-canary-85cc01743-20240202"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1191 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -9599,7 +9599,7 @@ var devToolsConfig$jscomp$inline_1054 = {
throw Error("TestRenderer does not support findFiberByHostInstance()");
},
bundleType: 0,
version: "18.3.0-canary-00f9acb12-20240202",
version: "18.3.0-canary-85cc01743-20240202",
rendererPackageName: "react-test-renderer"
};
var internals$jscomp$inline_1231 = {
@@ -9630,7 +9630,7 @@ var internals$jscomp$inline_1231 = {
scheduleRoot: null,
setRefreshHandler: null,
getCurrentFiber: null,
reconcilerVersion: "18.3.0-canary-00f9acb12-20240202"
reconcilerVersion: "18.3.0-canary-85cc01743-20240202"
};
if ("undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__) {
var hook$jscomp$inline_1232 = __REACT_DEVTOOLS_GLOBAL_HOOK__;
@@ -24,7 +24,7 @@ if (__DEV__) {
) {
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
}
var ReactVersion = "18.3.0-canary-00f9acb12-20240202";
var ReactVersion = "18.3.0-canary-85cc01743-20240202";
// ATTENTION
// When adding new symbols to this file,
@@ -545,4 +545,4 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-00f9acb12-20240202";
exports.version = "18.3.0-canary-85cc01743-20240202";
@@ -541,7 +541,7 @@ exports.useSyncExternalStore = function (
exports.useTransition = function () {
return ReactCurrentDispatcher.current.useTransition();
};
exports.version = "18.3.0-canary-00f9acb12-20240202";
exports.version = "18.3.0-canary-85cc01743-20240202";
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
"function" ===
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
@@ -1 +1 @@
00f9acb12c036ef24a2b6d7957d75359c6280087
85cc01743bc992a689770a4f37e3d5441f14f082