npm.io
0.0.5 • Published 9 years ago

react-router-v4-hocs

Licence
ISC
Version
0.0.5
Deps
0
Vulns
0
Weekly
0
DeprecatedThis package is deprecated

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

Usage
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:

    {
      hash: String
      pathname: String
      query: Object | null
      search: String
      state: Object | null
    }
withRouter
  • Give wrapped component router prop.

  • Default router shape:

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

Keywords