1.0.4 • Published 1 year ago
use-nav-state v1.0.4
use-nav-state
useNavState is a hook for react that extends useState for ReactJS.
Motivation
The motivation for this module was to do a simple state that interact with url and browser. With useNavState is updated, the values are sending to url params.
Instalation
npm i use-nav-state
or
yarn add use-nav-state
Usage
const [value, setValue] = useNavState("value");
Type
type TUseNavState = [value: string, setValue: (value: string) => void];
useNavState(key: string, initialValue?: string) : TUseNavState
Author
Github: @jaimeneto85