UNPKG

rooks

Version:

Essential React custom hooks ⚓ to super charge your components!

17 lines 622 B
import type { Dispatch, SetStateAction } from "react"; type UseLocalstorageStateReturnValue<S> = [ S, Dispatch<SetStateAction<S>>, () => void ]; /** * useLocalstorageState hook * Tracks a value within localStorage and updates it * * @param {string} key - Key of the localStorage object * @param {any} initialState - Default initial value * @see https://rooks.vercel.app/docs/useLocalstorageState */ declare function useLocalstorageState<S>(key: string, initialState?: S | (() => S)): UseLocalstorageStateReturnValue<S>; export { useLocalstorageState }; //# sourceMappingURL=useLocalstorageState.d.ts.map