Created
May 13, 2018 21:07
-
-
Save matiasfha/d4e15141b6664fe63d5775ee0a18577b to your computer and use it in GitHub Desktop.
Check props on componentWillMount
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Component extends React.Component { | |
componentWillMount() { | |
warning( | |
!(this.props.component && this.props.render), | |
"You should not use <Route component> and <Route render> in the same route; <Route render> will be ignored" | |
); | |
warning( | |
!( | |
this.props.component && | |
this.props.children && | |
!isEmptyChildren(this.props.children) | |
), | |
"You should not use <Route component> and <Route children> in the same route; <Route children> will be ignored" | |
); | |
warning( | |
!( | |
this.props.render && | |
this.props.children && | |
!isEmptyChildren(this.props.children) | |
), | |
"You should not use <Route render> and <Route children> in the same route; <Route children> will be ignored" | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment