UNPKG

react-use-storage-state

Version:
6 lines (5 loc) 371 B
import { Dispatch, SetStateAction } from 'react'; declare type Value<T> = T extends Function ? never : T; declare type NonFunctionalValue = Value<any>; export declare function useStorageState<T extends NonFunctionalValue>(key: string, initialState: T | (() => T), storageArea?: Storage): [state: T, setState: Dispatch<SetStateAction<T>>]; export default useStorageState;