react prop types "children" 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: react native typescript children prop
interface Props {
children: React.ReactNode;
}