use-search-hook
v0.2.2
Published
utilize this to quickly manipulate the search section of your url. Navigation may be enabled, but it not assumed. While built to be a react hook, it can be used in any style of Javascript application
Maintainers
Readme
use-search-hook
This module allows you to manipulate your url search string on the fly without effort, with optional navigation in response to changes.
Getting Started
To install, in terminal type
npm i --save use-search-hookthen, in your react project, or in any other module context
import useSearch from 'use-search-hook';and finally, implement it by including that component within your code:
const search = useSeach<yourObjectStyle>(yourDefaultObject)Using the search
search.key = valuethis would result in your url changing from yoursite.com/apath to yoursite.com/apath?key=value
search({a: "change", to: "search"})this would result in your url changing from yoursite.com/apath to yoursite.com/apath?a=change&to=search
