-
Notifications
You must be signed in to change notification settings - Fork 47.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PropTypes.oneOf warning does not include expected types #1919
Comments
You wanted oneOfType. :) We can probably make the message better though… |
👍 |
Perhaps |
Fixing this warning message. We're drifting away from proptypes and toward flow anyway, but if someone is looking for an easy PR, improving this error message would be a good one. |
The improvement was suggested in facebook#1919.
Might take a look at this. Thoughts: We probably only want to show a suggestion if check fails and all Would it be valuable to also attempt something like checking if each of |
Hi there !!, I would like to work on this bug. @spicyj @jgebhardt can anyone point me in right direction for working on this bug? |
@spicyj Hi. Is this bug still need to get fixed? I can work on it then. I want to contribute to the development of React project anyway possible. |
I just made the same silly mistake and was confused by the error message. Spicyj's comment pointed me to the solution though! |
PropTypes have been removed from React core and now exist as a separate package |
I've opened a new issue over at facebook/prop-types#9 for anyone looking to continue the discussion. |
PropType warnings for oneOf say
null
instead of the actual expected type.For example, for this PropType:
I get the following warning:
Example: http://jsfiddle.net/jxg/N76tr/
React v.0.11.0
The text was updated successfully, but these errors were encountered: