PaulieScanlon / gatsby-recipe-storybook-js

A Gatsby recipe to add Storybook to your JavaScript Gatsby project 🍳
8 stars 0 forks source link
gatsby gatsby-recipe gatsbyjs

gatsby-recipe-storybook-js

gatsby-recipe-storybook-js

There are two main problems with Gatsby and Storybook, you'll most likely experience Storybook build errors if you're doing either of the following.

  1. You're using <Link /> imported from gatsby
  2. You have components with embedded GraphQL queries

These are not problems with either Gatsby or Storybook but there are one or two things we need to do in order to get the two playing nicely together. The main reasons we get Storybook build errors are outlined below.

This recipe will automate the following steps

Wanna give it a try?


gatsby recipes https://raw.githubusercontent.com/PaulieScanlon/gatsby-recipe-storybook-js/master/gatsby-recipe-storybook-js.mdx

I've written a blog post about this recipe if you're looking for a little more information: https://paulie.dev/posts/2020/04/gatsby-recipe-storybook-js/