-
Notifications
You must be signed in to change notification settings - Fork 354
PropTypes throwing errors in production? #17
Comments
This seems to be an intentional design choice. From the readme in this repo:
I suspect the reasoning is that proptype checks are usually only done in development. However, I wonder why it doesn't just become a no-op in production, rather than throwing 😕 |
If I'm reading the docs correctly, this functionality should throw an error in a future major release.
So throwing an error now is unintentional and breaks production builds particularly where 3rd party libraries manually called proptype functions. |
This was an intentional breaking change in We need to put out a fix for this asap, thanks for reporting. |
To fix a breaking change which was not supposed to be included yet, we reverted the change in prop-types v15.5.7 and are now pulling that into React. Related to fixing facebook/prop-types#17
This is fixed in |
Fixed in |
In case anyone is confused, the intended behavior is explained here: I verified that |
Thanks 😄 I keep typing that for some reason |
Currently in React
15.5.0
, PropTypes called manually can result in an Error being thrown in production. This is due to theproductionTypeChecker
now being used in15.5.0
. We suspect that the boolean argument passed toinvariant
was either intended to be flipped, orwarning
was intended to be used instead here. Passingfalse
to invariant will always throw an error.We're currently seeing this occur in production as a result of using
react-router
v1.0.3, which expects PropType validators to return errors, and doesn't account for any errors being thrown.The text was updated successfully, but these errors were encountered: