# react-router-v4-hocs

> Set of higher order components for react router v4

Latest version **0.0.5** (published 2017-05-17) · ISC license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install react-router-v4-hocs
pnpm add react-router-v4-hocs
yarn add react-router-v4-hocs
bun add react-router-v4-hocs
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2017-05-17 |
| First published | 2016-11-03 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Xiaofan Wu |
| Maintainers | xiaofan2406 |
| Keywords | react, react-router, withRouter, withLocation |

## Links

- npm: https://www.npmjs.com/package/react-router-v4-hocs
- Repository: https://github.com/xiaofan2406/react-router-v4-hocs
- Homepage: https://github.com/xiaofan2406/react-router-v4-hocs#readme
- Issues: https://github.com/xiaofan2406/react-router-v4-hocs/issues
- npm.io page: https://npm.io/package/react-router-v4-hocs

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2017-05-17
- 0.0.4 — 2016-11-04
- 0.0.3 — 2016-11-04
- 0.0.2 — 2016-11-03

## README

# react-router-v4-hocs
> Set of higher order components for `React Router v4`

### @deprecated
latest version of `react-router-dom` includes `withRouter`

### [React Router v4 docs](https://react-router.now.sh/)


### Usage
```js
import withRouter from 'react-router-v4-hocs/lib/withRouter';
// import { withRouter } from 'react-router-v4-hocs';

class MyComponent extends React.Component {
  ...
}


export default withRouter(MyComponent);
```

### API

##### withLocation

- Give wrapped component `location` prop.
- Default `location` shape:

  ```js
  {
    hash: String
    pathname: String
    query: Object | null
    search: String
    state: Object | null
  }
  ```

##### withRouter
- Give wrapped component `router` prop.
- Default `router` shape:

  ```js
  {
    blockTransitions: Function
    createHref: Function
    replaceWith: Function
    transitionTo: Function
  }
  ```

---
_Source: https://npm.io/package/react-router-v4-hocs · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
