rooks
Version:
Essential React custom hooks ⚓ to super charge your components!
17 lines • 645 B
TypeScript
import type { Dispatch, SetStateAction } from "react";
declare 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://react-hooks.org/docs/useLocalstorageState
*/
declare function useLocalstorageState<S>(key: string, initialState?: S | (() => S)): UseLocalstorageStateReturnValue<S>;
export { useLocalstorageState };
//# sourceMappingURL=useLocalstorageState.d.ts.map