Package Exports
- use-search-hook
- use-search-hook/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-search-hook) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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