Closed kaiyoma closed 2 years ago
aha - I do see one incorrect usage of .hasOwnProperty
in factoryWithTypeCheckers
, added in #198 and included in v15.8.0. I'll get a fix out shortly.
Any chance you could provide the propType code you're using that generates that, so I can write a test case?
From what I can tell, our unit test code is passing PropTypes.exact(...)
as the first argument to checkPropTypes
and then passing an object that should validate.
Thanks! I'll see if i can repro it.
hmm, that doesn't seem to do it. Can you perhaps provide the exact code you're using?
Unfortunately this particular unit test code is kind of convoluted (and proprietary), so extracting a workable example isn't that easy. We're passing a multi-level object to PropTypes.exact
and a multi-level object as the data to test. It's very difficult to tell which property at which level is causing the problem.
I was able to reproduce it with a custom propType, but it'd be ideal to use non-contrived code if you can provide it :-)
It really won't be easy for me to provide it (and would require an investment of time I don't have), so I would suggest using your custom prop-type in the interest of getting out a quick fix.
Filed #370; that should do it. I'll have it released shortly.
v15.8.1 is released.
Thanks for the quick fix! I just tried it out and my unit tests are passing again. 🎉
I tried upgrading from 15.7.2 to 15.8.0 in my project and now I'm getting this error on some of our unit tests:
I've double-checked that I'm not passing undefined or null to
checkPropTypes
; all the data is valid and intact. This seems like an error insidecheckPropTypes
itself.