Skip to content

Conversation

@jsg2021
Copy link
Contributor

@jsg2021 jsg2021 commented Oct 27, 2016

Passing a React Component (which doesn't have a proptype anymore :|) generates a PropType error in the console. This will let it pass. (this mostly matches the handler propType spec, with the addition of string.)

Passing a React Component (which doesn't have a proptype anymore :|) generates a PropType error in the console. This will let it pass. (this mostly matches the handler propType spec, with the addition of string.)
@jamwaffles
Copy link

React.PropTypes.node would be more appropriate instead of this oneOfType(), no? .node allows anything that can be a valid props.children. Not sure if that's too broad in this instance however but it might fix the problem in a more elegant, idiomatic way.

@jsg2021
Copy link
Contributor Author

jsg2021 commented Oct 31, 2016

That would be too broad. The reason it accepts a string is so you can say "div"/"span". Essentially the value is passed to React.createElement function's first argument (the type) and the route will be given as its one and only child. The component/elementName passed must be able to render children given to it by the Router. (Otherwise you wind up not rendering the route)

@jsg2021
Copy link
Contributor Author

jsg2021 commented Nov 11, 2016

@STRML any objections?

@STRML
Copy link
Owner

STRML commented Nov 12, 2016

👍 Thanks.

@STRML STRML merged commit 1f64960 into STRML:master Nov 12, 2016
@jsg2021 jsg2021 deleted the patch-1 branch May 22, 2017 19:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants