-
Notifications
You must be signed in to change notification settings - Fork 38
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
Wrong prop types displayed in Storybook props table #2760
Comments
Why should you list the children prop unless it's something else than the default ReactNode?
|
Aye, having tested a bit this looks to be related specifically to the Its a good point of declaring jsdoc for I agree we should document when Lets do some testing with the |
Your propFilter prevents the children from being Docgenerated. That is why you need to define the prop yourself or tweak the filter.
But because you have specified that children arg in the Alert-story, Storybook guesses that children is of type 'string'
If you change the value of children in the story to true |
yeah, good catch! We added that filter because of performance problems locally with react-docgen scanning for types everywhere. We'll have to fix this somehow so that we get the correct types for children on all our components :) |
When declaring a default value for native props in our preview story, wrong type is displayed in the props table. It uses the type for the value declared in the preview story instead of the actual type on the component.
Notes;
string
default value for children in its preview story, resulting instring
being shown as the prop type instead of the native one,ReactNode
The text was updated successfully, but these errors were encountered: