We want to strip the code _that implements PropTypes validation functions_ in production. This doesnât mean React.PropTypes wonât existâjust that the functions will throw in production every time.
I did an initial attempt at this in #6401 but itâs too much of a change because people might be calling PropTypes in production right now for introspection, and weâd need to deprecate calling them in production before actually turning them into shims that throw errors.
@spicyj suggested a good first step: we should pass an extra argument to propType checkers. We would warn if that argument is not passed (or, if passed, does not match our âsecretâ value). This way we can detect if somebody manually calls PropTypes validators, and warn with console.error in production.
If youâd like to work on this, please comment here so we donât have many people implementing this at the same time. You would need to:
You are manually calling React.PropTypes validation functions in a production build. This is deprecated and will not work in the next major version.I'd be happy to work on this!
Itâs yours! đ
Most helpful comment
I'd be happy to work on this!