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
ArgTypes defaultValue
displaying as blank in preview.
#11983
Comments
Not sure if this is a bug, but I had to add a Here's an example: export default {
title: 'Accordion',
component: Accordion,
argTypes: {
isExpanded: {
control: "boolean",
defaultValue: false,
description: "if true, acoordion is expanded on render",
table: {
type: { summary: 'boolean' },
defaultValue: { summary: false },
}
},
},
} |
@marie-maxime What you've pasted is correct. However, the |
Thank you for the alternative @marie-maxime , I'm using that for now until I figure out what I'm doing wrong. The I found this helpful table that details the The |
Having the same issue with angular and compodoc when using |
Hey ! This problem is maybe caused by an early return in the
Should |
To affect the For example: export default {
component: MyComponent,
argTypes: {
argName: {
table: { defaultValue: { summary: 'SomeType<T>' } },
},
},
}; For the current state of Closing this as not a bug! |
@shilman I'm still seeing it as an issue in React with MDX, but only for the ArgsTable element in docs view. On the Canvas view, it shows the default.
|
@michaelfaith Do you a have a reproduction repo you can share? If not, can you create one? See how to create a repro. |
Check my comment about this in #12644 (comment) |
@shilman I just created this repo demonstrating the bug https://github.com/michaelfaith/storybook-mdx-argtype-bug |
Went ahead and opened a new issue here: #15838 |
Same issue here, but not on tables, the defaultValue under a prop is not populating the children field (have tried at one level higher)... react mdx. When i manually enter text to the children field in the addons section it populates the canvas with the mapping i.e. a reactNode, but i was / am hoping to have the node declared in the stories.mdx file and have a default mapping applied.
|
For anyone visiting this page, this is now possible with |
@sai-github Does this solve it?
|
Describe the bug
Providing a value for the
defaultValue
key in theArgType
object results in nothing being displayed on preview.To Reproduce
Steps to reproduce the behavior:
Expected behavior
The value of
devaultValue
would appear under the Default section of the Controls addon.Screenshots
Code snippets
System:
The text was updated successfully, but these errors were encountered: