0.0.10 • Published 2 years ago

use-param-state v0.0.10

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

useParamState

React hook that works much like useState, but it encodes the state and saves it in a parameter in the URL.

Installation

yarn add use-param-state or npm i use-param-state

Usage

The hook accepts an object as a prop with the following properties:

  • initialState?: <T> – The initial state
  • key: string – The URL parameter key for the encoded state
import {useParamState} from 'use-param-state'

const [state, setState] = useParamState<string>({
  initialState: 'Hello world',
  key: 'myKey',
})
0.0.10

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago