You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 1, 2024. It is now read-only.
In a project we noticed that having typos in prop type definitions that are nested inside a PropTypes.shape do not generate warnings in version 15.6.2:
{a: PropTypes.shape({b: PropTypes.boolean// <- is undefined})}
Warning: Failed undefined type: React class: undefined type `a` is invalid; it must be a function, usually from the `prop-types` package, but received `undefined`.
Case 2, however, does not output any error or warning 😞 In other words, it seems like if you use an invalid validator inside a PropTypes.shape, validation will always pass and no compile time warning or error is visible, which means there might be potential for some sneaky runtime bugs.
I've tested this in many different versions (as low as 0.2.0 and 0.1.0 and it seems to be consistent across all versions.
Is this somehow the intended behaviour? If so, what is a good way to get compile-time errors/warnings for invalid validators used inside PropTypes.shape?