Closed patsplat closed 5 years ago
Thanks for the 👍
This addition is also intended to make spying console.error
for expected warnings reliable. Currently mocha --watch
fails on rebuilds.
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 checkPropTypes
, and not on the PropTypes
object itself?
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 checkPropTypes
as that is the unit whose state is modified.
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 PropTypes.resetWarningCache
. Still need to reach inside checkPropTypes
to clear the cache.
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