react-route-params
v1.1.0
Published
Elegant, light and simple query param support for React
Downloads
11
Readme
react-route-params
Elegant, light and simple query param support for React
Why this is useful?
This simple utililty extracts away the headache of dealing with search or hash parameters on your application route and instead allows you to work with a simple object of key / value pairs.
- Lightweight (less than 1kb)
- No additional dependencies
- Support for React and Vanilla JS / jQuery applications
- Supports both search and hash parameters
Usage
// http://example.com/search?foo=bar&boo=baz
const params = require('react-route-params');
const query = params.get();
console.log(query);
/*
{
foo: 'bar',
boo: 'baz
}
*/
Installation
$ npm install --save react-route-params
# or
$ yarn install react-route-params
Run tests
$ npm test
# or
$ yarn test