-
-
Notifications
You must be signed in to change notification settings - Fork 301
Enum strings in propTypes are wrapped in a tick #57
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
Comments
Mmh, good question. I think the way it is now is how I originally intended it to be (because I imagined the values would be rendered somewhere and as such you want to represent a string with quotes). Now however I think there are better ways to handle this. I could imagine that This would be a breaking change though. I'd be happy to have a discussion around revisiting the data structure in general and around |
Sound pretty good. I wonder how valuable a big time investment into propTypes is as the React core team announced to move more into the Flow direction (which I'm personally happy about). see facebook/react#1833 (comment) @fkling totally makes sense regarding the current wrapping of value. In our case we right now try to come up with a normalized structure that suites Flow & PropTypes. That might result in some interesting insight, but right now it's still an exploration phase. see https://github.com/pure-ui/styleguide/blob/master/plugin/normalize-meta-info.js btw will you be at the React Conf? I'm happy to meet & discuss it in person as well |
@nikgraf: Unfortunately I'm not adding the React Conf. But I hope we find other ways to discuss :)
I still think code using Then we should deal with inconsistencies and surprises. |
I defined a propType like this:
This resulted in:
You can see the shy is wrapped in a single tick and in double quotes. Kind of a string in a string ;)]
Is this a feature or bug? I'm happy to submit a PR in case this is a bug.
Additional info: when I use numbers they are also presented as a String:
The text was updated successfully, but these errors were encountered: