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

Controls: String literal type with "." in it uses "object" control #12008

Open
ofagbemi opened this issue Aug 13, 2020 · 2 comments
Open

Controls: String literal type with "." in it uses "object" control #12008

ofagbemi opened this issue Aug 13, 2020 · 2 comments

Comments

@ofagbemi
Copy link

@ofagbemi ofagbemi commented Aug 13, 2020

Describe the bug
I noticed in my TypeScript + React app, if I specify a string enum with string literals that have dots "." in them, the control appears to default to the "object" control text area. I'm using storybook@6.0.6.

To Reproduce

  1. Follow the steps in this setup guide: https://gist.github.com/shilman/69c1dd41a466bae137cc88bd2c6ef487
  2. Add a prop test: 'test.thing' | 'other.thing' to the ButtonProps interface defined in Button.tsx.
  3. Start storybook and view Button story
  4. See that the new "test" control has the object control text area

Expected behavior
"test" control should be a select element with "test.thing" and "other.thing" as options

@shilman
Copy link
Member

@shilman shilman commented Aug 14, 2020

This might be an issue in react-docgen-typescript? cc @hipstersmoothie

@Morteza-Jenabzadeh
Copy link

@Morteza-Jenabzadeh Morteza-Jenabzadeh commented Aug 14, 2020

As I saw the code row.type is wrong but can't figure out which part of the code cause this
@shilman @hipstersmoothie any hint that I can contribute to this issue?

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.