diff --git a/src/useLocalStorage.ts b/src/useLocalStorage.ts index 03ba939274..051685be63 100644 --- a/src/useLocalStorage.ts +++ b/src/useLocalStorage.ts @@ -1,7 +1,10 @@ import { useEffect, useState } from 'react'; import { isClient } from './util'; -const useLocalStorage = (key: string, initialValue?: T, raw?: boolean): [T, (value: T) => void] => { +type Dispatch = (value: A) => void; +type SetStateAction = S | ((prevState: S) => S); + +const useLocalStorage = (key: string, initialValue?: T, raw?: boolean): [T, Dispatch>] => { if (!isClient) { return [initialValue as T, () => {}]; }