-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Addon-docs Props: Convert default prop value to string #9525
Addon-docs Props: Convert default prop value to string #9525
Conversation
This pull request is being automatically deployed with ZEIT Now (learn more). 🔍 Inspect: https://zeit.co/storybook/monorepo/olnjco00g |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@patricklafrance @tmeasday Can you think of any places where this would cause problems? |
I don't think so. That being said, why do this in the components instead of the code that transform react-docgen data code to display data? Feels hacky. Should also be done in a dedicated TypeScript transformation pipeline since it only happens for TS. |
BTW I believe settings react-docgen-typescript https://github.com/styleguidist/react-docgen-typescript#parseroptions |
@patricklafrance thanks for the feedback Here are a few thoughts on my side
|
Hey @atanasster You’re right the PropValue is a correct place to ensure it’s a string. What I don’t like about it is that currently all the code that take care of these concerns is in the data transformation layer, not in the rendering layer. This is splitting the same concern in 2 places which makes the code harders to maintain if we continue this way. A future refactor in 6.0 might change this, but in the current state, this is how it’s been built. |
Thanks @patricklafrance - you are right, lets work on refactoring that part for 6? |
Issue: #9394
What I did
How to test
use cra-ts-kitchen-sink