You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When I write a story in the syntax export const ExampleStory: Story<ExampleProps> = (args) => { ... } the code output (preview) is only the render part of JSX (with args applied to its components properties), but local states and functions are missing / not shown:
There's a parameter docs.source.type which controls how the story is rendered, but isn't documented yet. There's a heuristic in the Source block that goes:
If it's an args story, render it with type 'dynamic'
Otherwise, render it with type 'code'
If you want your args story to render like the bottom example, you can force it:
@tobiaskraus thanks for bringing this to our attention. I've recently created a pull request to better document this feature. Hopefully it will be merged soon and not only you but the rest of the community will benefit from this feature.
@tobiaskraus closing this as the pull request was merged and the documentation is updated to include the issue you've raised. Once again thank you for bringing this to our attention.
Describe the bug
When I write a story in the syntax
export const ExampleStory: Story<ExampleProps> = (args) => { ... }
the code output (preview) is only the render part of JSX (with args applied to its components properties), but local states and functions are missing / not shown:Example 1: Bug
Story
Code Preview in Docs-Addon
Example 2: Works (without args)
when I don't use args as story param, then the whole FunctionComponent of the story (with functions and state) gets shown as Code Preview:
Story
Code Preview in Docs-Addon
Expected behavior
The whole Story (not only the render part) should always be shown. Also when
args
are getting applied.System
The text was updated successfully, but these errors were encountered: