diff --git a/packages/hooks/src/createUseStorageState/index.ts b/packages/hooks/src/createUseStorageState/index.ts index 70a3e2cd9e..591f9b1963 100644 --- a/packages/hooks/src/createUseStorageState/index.ts +++ b/packages/hooks/src/createUseStorageState/index.ts @@ -40,7 +40,7 @@ export function createUseStorageState(getStorage: () => Storage | undefined) { return JSON.stringify(value); }; - const deserializer = (value: string): T => { + const deserializer = (value: string) => { if (options.deserializer) { return options.deserializer(value); } @@ -62,13 +62,13 @@ export function createUseStorageState(getStorage: () => Storage | undefined) { return options.defaultValue; } - const [state, setState] = useState(getStoredValue); + const [state, setState] = useState(getStoredValue); useUpdateEffect(() => { setState(getStoredValue()); }, [key]); - const updateState = (value?: SetState) => { + const updateState = (value: SetState) => { const currentState = isFunction(value) ? value(state) : value; if (!listenStorageChange) {