Closed
Description
When a stateless component is created as a property of an object, prop-types
gives false negative:
🚫 reports "'children' is missing in props validation":
Panel.Body = ({children}) => (
<div className='Panel-body'>
{children}
</div>
)
Panel.Body.propTypes = {
children: PropTypes.node
}
👌🏽 works fine:
const Body = ({children}) => (
<div className='Panel-body'>
{children}
</div>
)
Body.propTypes = {
children: PropTypes.node
}
Panel.Body = Body