UNPKG

use-history-state

Version:

`use-history-state` is replacement for `useState` that stores the state within the history state.

5 lines (4 loc) 287 B
import { SetStateAction } from "react"; declare type Dispatch<Action> = (newState: Action, replace: boolean) => void; declare function useHistoryState<State>(initialState: State | (() => State), key: string): [State, Dispatch<SetStateAction<State>>]; export default useHistoryState;