props children type react ts code example
Example 1: react children typescript
interface Props {
children: JSX.Element[] | JSX.Element
}
Example 2: react props.children proptype
import PropTypes from 'prop-types'
...
static propTypes = {
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node
]).isRequired
}