Skip to content
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

chore(docs): Add note to Storybook guide about StaticImage #33127

Merged
merged 1 commit into from
Sep 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/docs/how-to/testing/visual-testing-with-storybook.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,8 @@ Storybook v6 has [out-of-the-box support for TypeScript](https://storybook.js.or

A complete guide to writing stories is beyond the scope of this guide, but we'll take a look at creating a story.

> **Note:** Writing stories for components that use `StaticImage` from `gatsby-plugin-image` is currently not supported. Contributions to making this possible are welcome.

First, create the story file. Storybook looks for all files with a `.stories.js` extension and loads them into Storybook for you. Generally, you will want your stories near where the component is defined. However, since this is Gatsby, you will have to create those files outside the `pages` directory if you want stories for your pages.

A good solution is to use the `stories` directory which was created when Storybook was installed and put any page stories in there.
Expand Down