From f35eb5736f36068847e43793bca2dac30c3bee57 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Fri, 2 Feb 2024 19:59:47 +0100 Subject: [PATCH] Add useOptimistic to devtools shell --- .../src/app/InspectableElements/CustomHooks.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/react-devtools-shell/src/app/InspectableElements/CustomHooks.js b/packages/react-devtools-shell/src/app/InspectableElements/CustomHooks.js index 939b2fa20e0dd..e38e2a75eb07c 100644 --- a/packages/react-devtools-shell/src/app/InspectableElements/CustomHooks.js +++ b/packages/react-devtools-shell/src/app/InspectableElements/CustomHooks.js @@ -17,6 +17,7 @@ import { useContext, useDebugValue, useEffect, + useOptimistic, useState, } from 'react'; @@ -73,6 +74,7 @@ function FunctionWithHooks(props: any, ref: React$Ref) { const [count, updateCount] = useState(0); // eslint-disable-next-line no-unused-vars const contextValueA = useContext(ContextA); + useOptimistic(1); // eslint-disable-next-line no-unused-vars const [_, __] = useState(object);