use-nav-state
v1.0.4
Published
React State that update and it's updated by Query Params
Downloads
11
Readme
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