Skip to content
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 relies upon stringification when using Symbols #9181

Closed
ZebraFlesh opened this issue Mar 15, 2017 · 2 comments
Closed

PropTypes.oneOf relies upon stringification when using Symbols #9181

ZebraFlesh opened this issue Mar 15, 2017 · 2 comments

Comments

@ZebraFlesh
Copy link

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
React.PropTypes.oneOf prints a less than helpful error message when passed a Symbol which is not in the target value set: Failed prop type: Cannot convert a symbol to a string

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://jsfiddle.net or similar.

http://codepen.io/anon/pen/BWdEKb?editors=1011#0

What is the expected behavior?
oneOf prints the same or similar helpful error message that other primitive types get:
Failed prop type: Invalid prop `symbolSize` of value `Symbol(medium)` supplied to `Thing`, expected one of [Symbol(small),Symbol(large)].

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
React 15.4.2
macOS 10.12.3 / Safari 10.0.3 and Chrome 57.0.2987.98
Never worked

@aweary
Copy link
Contributor

aweary commented Apr 9, 2017

PropTypes have been removed from React core and now exist as a separate package prop-types. Any future feature requests, bug reports, or changes should be directed to the new repo at https://github.com/reactjs/prop-types.

@ljharb
Copy link
Contributor

ljharb commented Feb 8, 2019

Fixed in facebook/prop-types#224.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants