-
Notifications
You must be signed in to change notification settings - Fork 356
v15.8.0 breaks PropTypes.shape({...})
for objects and class-instances.
#368
Comments
PropTypes.shape({.......})
for objects and class-instances.PropTypes.shape({....})
for objects and class-instances.
PropTypes.shape({....})
for objects and class-instances.PropTypes.shape({...})
for objects and class-instances.
maybe @ljharb has any clue what happens here? 😅 |
I have no idea how that PR could have broken it, but I’ll definitely look into it today. |
Can you share a bit more about your setup? There's extensive tests that PR adds to that already prove this works - and if this didn't work, I'd expect it to take much less than 6 days for the first bug report. |
In particular, a codesandbox that reproduces it would be most helpful. |
This error also occurs on our project RegardsOSS. |
I will be happy to fix it once it’s reproducible. |
This happened in our codebase aswell. The warning was caused by using options: PropTypes.shape({
readOnly: PropTypes.boolean,
}), changing it to options: PropTypes.shape({
readOnly: PropTypes.bool,
}), helped. In the above examples there is
Maybe try changing it to (note the camel case)
will help, too. |
Thanks, my build is passing now. I had some invalid proptypes that are reported with this updates. |
That’s great! So it sounds like v15.8 is helping you find invalid PropTypes, and isn’t actually breaking anything that should be working? |
Yes, any key associated with an undefined value now warns I had |
@Kegulf given this, I’m going to close this issue, but will be happy to reopen it if there’s a repro case for something failing that should work. |
propChecking related to
PropTypes.shape
being used with objects and class-instances seems to be broken in v15.8.0.It works in v15.7.2.
I think that it's this PR that broke it.
The result is my tests failing with the following warning:
My specific case:
It also fails when I try to take in a
shape
instead ofarrayOf(shape)
:It fails with the same warning if I change
receiptLinks
to JS-objects as well:The text was updated successfully, but these errors were encountered: