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

Commit

Permalink
docs: use new prop-types package [fixes #483] (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
morajabi authored and istarkov committed Aug 19, 2017
1 parent 5625fef commit a2ded66
Showing 1 changed file with 5 additions and 3 deletions.
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

0 comments on commit a2ded66

Please sign in to comment.