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:
parent
4833e2ffb5
commit
61ffc6da7f
11
lib/link.js
11
lib/link.js
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue