react-ui
react-ui copied to clipboard
proptype validation too strict
In the following components:
CTACardFormLayoutMediaTabs
we validate the children prop with:
children: PropTypes.oneOfType([
PropTypes.element,
PropTypes.arrayOf(PropTypes.element),
]).isRequired,
This is too strict, because it fails when false is passed in. This is common with idomatic code such as:
<CTA>
{condition && <CTAStart />}
</CTA>
We should probably use children: PropTypes.node.isRequired to revert it to the state before https://github.com/react-ui-org/react-ui/pull/301 was merged.
Since propType validation is off in production builds, this has no effect on production code.