-
Notifications
You must be signed in to change notification settings - Fork 356
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is excellent; in our tests we never want to suppress warnings, so we’d run this before every test.
Thanks for the 👍 This addition is also intended to make spying |
cc @aweary |
Hi! Any updates or feedback on this PR? |
Closing due to inactivity. If you are interested in this feel free to reopen. |
Please reopen this; inactivity is irrelevant. |
@ljharb any suggestions on next steps for this PR? |
Unfortunately we have to wait for the maintainers to take a look. |
Is there any specific reason it's on I'm worried if attaching things to functions can mess with uglify/rollup "pure" code detection. Not that it matters for this piece of code but still. |
It does seem useful to me to have it tucked away somewhere - devs are less likely to casually use it that way. |
Implemented on |
Happy if library maintainers want to move the interface around, but figured it could start in the most naive spot first. |
This would be awesome! It would make eg. https://github.com/ratehub/check-prop-types obsolete, which would make me (its creator) very happy. |
@gaearon changed the public interface to Are there any other recommended changes? |
💃 |
Thanks @ljharb ! |
When testing code using PropTypes, warnings fail unexpectedly due to caching behavior. It would be useful for
resetWarningCache
to be part of the publicly exported API.PropTypes.checkPropTypes
PropTypes.checkPropTypes.resetWarningCache
PropTypes.checkPropTypes.resetWarningCache
PropTypes.checkPropTypes.resetWarningCache