1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Change next/link proptypes to support the API. (#2607)

Add propTypes for replace and object support for href and as.
This commit is contained in:
Arunoda Susiripala 2017-07-20 21:54:04 +05:30 committed by GitHub
parent 4833e2ffb5
commit 61ffc6da7f

View file

@ -15,9 +15,12 @@ export default class Link extends Component {
}
static propTypes = exact({
href: PropTypes.string,
as: PropTypes.string,
href: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
as: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
prefetch: PropTypes.bool,
replace: PropTypes.bool,
shallow: PropTypes.bool,
passHref: PropTypes.bool,
children: PropTypes.oneOfType([
PropTypes.element,
(props, propName) => {
@ -29,9 +32,7 @@ export default class Link extends Component {
return null
}
]).isRequired,
shallow: PropTypes.bool,
passHref: PropTypes.bool
]).isRequired
})
componentWillReceiveProps (nextProps) {