proptype in react class code example
Example 1: react props.children proptype
import PropTypes from 'prop-types'
...
static propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node
]).isRequired
}
Example 2: how to make proptypes either or
size: PropTypes.oneOfType([
PropTypes.string,
PropTypes.number
]),