with-location

1.3.8 • Public • Published

🗺️ with-location

Status Coverage Status

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

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) => (
  <LocationProvider>
    {(utils) => {
      // utils now includes the location decorators
      return null;
    }}
  </LocationProvider>
);

Readme

Keywords

none

Package Sidebar

Install

npm i with-location

Weekly Downloads

9

Version

1.3.8

License

MIT

Unpacked Size

20 kB

Total Files

14

Last publish

Collaborators

  • 3merge