Currently users may be providing True or False for boolean properties or numbers for numeric properties. This is valid. With our previous propTypes, these would fail under validation as they are not string.
This PR enables those boolean & numeric properties.
Currently users may be providing
True
orFalse
for boolean properties or numbers for numeric properties. This is valid. With our previous propTypes, these would fail under validation as they are notstring
.This PR enables those boolean & numeric properties.
There is a lot more we could do here for deeper validation (e.g. incorporate https://github.com/iandevlin/html-attributes/blob/master/enumerated-attributes.json) however I’d like to keep this PR focused on making sure that existing user’s code doesn’t break (even if it might not be technically valid under the HTML5 spec).