2.5.2 • Published 6 years ago

history-prop-types v2.5.2

Weekly downloads
1,015
License
MIT
Repository
-
Last release
6 years ago

history-prop-types

History propTypes help validate in React context (and for propTypes users in general) an history object created via one of the create* method of the history package.

It asserts the history object has the right shape when wrapping an existing router (or creating a custom one).

Install

npm install --save history-prop-types

Usage

To validate a whole history object in a custom router:

import { history as historyPropTypes } from 'history-prop-types';

class MyCustomRouter extends Component {
  static propTypes = {
    ...
    history: PropTypes.shape(historyPropTypes),
    ...
  };
  ...
}

Or to validate a location object only: import { location as locationPropTypes } from 'history-prop-types';

About

This package will live if these propTypes never make it to the history package.

See PR https://github.com/ReactTraining/history/pull/549

Licence

MIT

2.5.2

6 years ago

2.4.1

6 years ago

2.4.0

6 years ago

2.3.0

6 years ago

2.2.0

6 years ago

2.1.9

6 years ago

2.1.8

6 years ago

2.1.7

6 years ago

2.1.6

6 years ago

2.1.5

6 years ago

2.1.4

6 years ago

2.1.3

6 years ago

2.1.2

6 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

1.5.0

6 years ago

1.4.1

6 years ago

1.4.0

6 years ago