Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

docs: use new prop-types package [fixes #483] #484

Merged
merged 1 commit into from
Aug 19, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,14 @@ Works like `onlyUpdateForKeys()`, but prop keys are inferred from the `propTypes
If the base component does not have any `propTypes`, the component will never receive any updates. This probably isn't the expected behavior, so a warning is printed to the console.

```js
import PropTypes from 'prop-types'; // You need to import prop-types. See https://facebook.github.io/react/docs/typechecking-with-proptypes.html

const enhance = compose(
onlyUpdateForPropTypes,
setPropTypes({
title: React.PropTypes.string.isRequired,
content: React.PropTypes.string.isRequired,
author: React.PropTypes.object.isRequired
title: PropTypes.string.isRequired,
content: PropTypes.string.isRequired,
author: PropTypes.object.isRequired
})
)

Expand Down