diff --git a/packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js b/packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js index c196a8d83b74e..a0429bf8d37de 100644 --- a/packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js +++ b/packages/react-devtools-shared/src/devtools/views/Components/EditableValue.js @@ -17,7 +17,6 @@ type OverrideValueFn = (path: Array, value: any) => void; type EditableValueProps = {| className?: string, - dataType: string, initialValue: any, overrideValueFn: OverrideValueFn, path: Array, @@ -25,7 +24,6 @@ type EditableValueProps = {| export default function EditableValue({ className = '', - dataType, initialValue, overrideValueFn, path, diff --git a/packages/react-devtools-shared/src/devtools/views/Components/HooksTree.js b/packages/react-devtools-shared/src/devtools/views/Components/HooksTree.js index 2fd4f95cbdb4f..ce0be7c47a1ef 100644 --- a/packages/react-devtools-shared/src/devtools/views/Components/HooksTree.js +++ b/packages/react-devtools-shared/src/devtools/views/Components/HooksTree.js @@ -270,10 +270,9 @@ function HookView({canEditHooks, hook, id, inspectPath, path}: HookViewProps) { {typeof overrideValueFn === 'function' ? ( ) : ( // $FlowFixMe Cannot create span element because in property children diff --git a/packages/react-devtools-shared/src/devtools/views/Components/KeyValue.js b/packages/react-devtools-shared/src/devtools/views/Components/KeyValue.js index e05a35fc57a7f..9e82eefa426fb 100644 --- a/packages/react-devtools-shared/src/devtools/views/Components/KeyValue.js +++ b/packages/react-devtools-shared/src/devtools/views/Components/KeyValue.js @@ -102,10 +102,9 @@ export default function KeyValue({ {isEditable ? ( ) : ( {displayValue} diff --git a/packages/react-devtools-shared/src/devtools/views/hooks.js b/packages/react-devtools-shared/src/devtools/views/hooks.js index f027f751d399f..57ebb69f6e01c 100644 --- a/packages/react-devtools-shared/src/devtools/views/hooks.js +++ b/packages/react-devtools-shared/src/devtools/views/hooks.js @@ -8,13 +8,7 @@ */ import throttle from 'lodash.throttle'; -import { - useCallback, - useEffect, - useLayoutEffect, - useMemo, - useState, -} from 'react'; +import {useCallback, useEffect, useLayoutEffect, useState} from 'react'; import {unstable_batchedUpdates as batchedUpdates} from 'react-dom'; import { localStorageGetItem, @@ -42,11 +36,14 @@ export function useEditableValue( const [parsedValue, setParsedValue] = useState(initialValue); const [isValid, setIsValid] = useState(initialIsValid); - const reset = useCallback(() => { - setEditableValue(smartStringify(initialValue)); - setParsedValue(initialValue); - setIsValid(initialIsValid); - }, []); + const reset = useCallback( + () => { + setEditableValue(smartStringify(initialValue)); + setParsedValue(initialValue); + setIsValid(initialIsValid); + }, + [initialValue, initialIsValid], + ); const update = useCallback(newValue => { let isNewValueValid = false; @@ -65,17 +62,14 @@ export function useEditableValue( }); }, []); - return useMemo( - () => ({ - editableValue, - hasPendingChanges: smartStringify(initialValue) !== editableValue, - isValid, - parsedValue, - reset, - update, - }), - [editableValue, initialValue, isValid, parsedValue], - ); + return { + editableValue, + hasPendingChanges: smartStringify(initialValue) !== editableValue, + isValid, + parsedValue, + reset, + update, + }; } export function useIsOverflowing(