Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mikeibberson/with-location
@reach/router location HOC component
https://github.com/mikeibberson/with-location
higher-order-component reach-router react
Last synced: 19 days ago
JSON representation
@reach/router location HOC component
- Host: GitHub
- URL: https://github.com/mikeibberson/with-location
- Owner: MikeIbberson
- License: mit
- Created: 2019-12-09T20:58:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:26:57.000Z (almost 2 years ago)
- Last Synced: 2024-10-12T12:15:57.367Z (about 1 month ago)
- Topics: higher-order-component, reach-router, react
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/with-location
- Size: 1.68 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
πΊοΈ with-location
Custom Provider and HOC components for @reach/router
Available injected/inherited props
| Name | Descriptions | Args |
| -------------- | ------------------------------------------------------------------------------- | -------------------- |
| `getFrom` | Get query value as string or object (will return a merged object) | `object` or `string` |
| `pushTo` | Add a new value to the query string | `any` |
| `clearByName` | Create a curried callback for clear-style UI elements | `fn` => `event` |
| `handleSearch` | Create a submit callback for handling search inputs (will delete paged queries) | `fn` => `event` |
| `getAll` | Returns an object of all params in play | |Example
```Javascript
import React from 'react';
import { withLocation, LocationProvider } from 'with-location';const AsHoc = withLocation((props) => {
// props now includes the location decorators
return null;
});const AsComponent = (props) => (
{(utils) => {
// utils now includes the location decorators
return null;
}}
);
```