Skip to content

Commit

Permalink
Merge pull request #12777 from storybookjs/fix_issue_10856
Browse files Browse the repository at this point in the history
Chore: update documentation to address issue #10856
  • Loading branch information
shilman authored Jun 5, 2021
2 parents 97f0f03 + 5efc85b commit 85426d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion docs/workflows/stories-for-multiple-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,18 @@ One way we improve that situation is by pulling the rendered subcomponent out in

Now that `children` is an arg, we can potentially reuse it in another story.

However, there are some caveats when using this approach that you should be aware of.

The `children` `args` as any other arg needs to be JSON serializable. It means that you should:

- Avoid using empty values
- Use caution with components that include third party libraries

As they could lead into errors with your Storybook.

<div class="aside">

As things stand (we hope to improve this soon) you cannot edit children in a control yet.
We're currently working on improving the overall experience for the children arg and allow you to edit children arg in a control and allow you to use other types of components in the near future. But for now you need to factor in this caveat when you're implementing your stories.

</div>

Expand Down
2 changes: 1 addition & 1 deletion docs/writing-stories/args.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Learn how and why to write stories in [the introduction](./introduction.md#using

## Args object

The args object can be defined at the story and component level (see below). It is an object with string keys, where values can have any type that is allowed to be passed into a component in your framework.
The args object can be defined at the story and component level (see below). It is a JSON serializable object, composed of string keys with matching valid value types that can be passed into a component for your framework.

## Story args

Expand Down

0 comments on commit 85426d9

Please sign in to comment.