UNPKG

rooks

Version:

Essential React custom hooks ⚓ to super charge your components!

18 lines 727 B
import type { Dispatch, SetStateAction } from "react"; declare type UseSessionstorateStateReturnValue<S> = [ S, Dispatch<SetStateAction<S>>, () => void ]; /** * useSessionstorageState hook * Tracks a value within sessionStorage and updates it * * @param {string} key - Key of the sessionStorage object * @param {any} initialState - Default initial value * @returns {[any, Dispatch<SetStateAction<any>>, () => void]} * @see https://react-hooks.org/docs/useSessionstorageState */ declare function useSessionstorageState<S>(key: string, initialState?: S | (() => S)): UseSessionstorateStateReturnValue<S>; export { useSessionstorageState }; //# sourceMappingURL=useSessionstorageState.d.ts.map