Given a simple component that renders its children:
class ContainerComponent extends Component { static propTypes = { children: PropTypes.object.isRequ
Try something like this utilizing oneOfType or PropTypes.node
oneOfType
PropTypes.node
import PropTypes from 'prop-types' ... static propTypes = { children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), PropTypes.node ]).isRequired }
or
static propTypes = { children: PropTypes.node.isRequired, }