Answers for "how to pass props type in props.children"

4

react props.children proptype

import PropTypes from 'prop-types'

...

static propTypes = {
    children: PropTypes.oneOfType([
        PropTypes.arrayOf(PropTypes.node),
        PropTypes.node
    ]).isRequired
}
Posted by: Guest on November-11-2020
0

pass children props type scriot

children: React.ReactNode
Posted by: Guest on June-22-2021

Code answers related to "how to pass props type in props.children"

Code answers related to "Javascript"

Browse Popular Code Answers by Language