Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes to PropTypes #3274

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
5 changes: 3 additions & 2 deletions modules/Link.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import React from 'react'
import warning from './routerWarning'
import { to } from './PropTypes'

const { bool, object, string, func, oneOfType } = React.PropTypes
const { bool, object, string, func } = React.PropTypes

function isLeftClickEvent(event) {
return event.button === 0
Expand Down Expand Up @@ -53,7 +54,7 @@ const Link = React.createClass({
},

propTypes: {
to: oneOfType([ string, object ]).isRequired,
to: to.isRequired,
query: object,
hash: string,
state: object,
Expand Down
4 changes: 3 additions & 1 deletion modules/PropTypes.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ export const component = oneOfType([ func, string ])
export const components = oneOfType([ component, object ])
export const route = oneOfType([ object, element ])
export const routes = oneOfType([ route, arrayOf(route) ])
export const to = oneOfType([ string, object ])

export default {
falsy,
history,
location,
component,
components,
route
route,
to
}