DEV Community

Discussion on: Loading states with Storybook and Mock Service Worker

Collapse
 
kettanaito profile image
Artem Zakharchenko

Great overview, Mike!

A nitpick, but it's more common to render the "story" exposed in a decorator, instead of calling it as a function:

StoryName.decorators = [
  (Story) => {
    return <Story />
  }
]
Enter fullscreen mode Exit fullscreen mode

Although React components are functions, rendering them as JSX elements is more transparent in terms of what's going on. This is also how the decorators are recommended in the Storybook docs.