What are the different types of PropTypes I can use?
// How to require a component to have children
static propTypes = {
children: PropTypes.node.isRequired
}
// How to require a named property is of type string and that it is required
static propTypes = {
firstName: PropTypes.string.isRequired
}
PreviousHow can I conditionally render JSX?NextHow can I handle a component throwing an uncaught exception?
Last updated
Was this helpful?