Skip to content

chrisdunnbirch/storybook-sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Storybook 5.2 should add hooks support to stories but I cannot get it to work.

This repository is a barebones CRA with @storybook/react@next (5.2.0-beta.30) and node-sass to limit any other potential causes from my client repos.

Problem

yarn storybook shows an eslint warning for react-hooks/rules-of-hooks on initial load.

When a .stories.js file with a hook is edited and saved storybook will hot reload with the same eslint-loader warning in the background (terminal).

When any other .stories.js file or any normal React component that is imported in to any story is edited and saved, storybook will hot reload with an eslint-loader error (terminal & preview).

Test

  1. Clone this repo
  2. yarn install
  3. yarn storybook
  • Expected behaviour:
    • Storybook will load successfully with an eslint warning for react-hooks/rules-of-hooks in the terminal.
  1. Modify /src/components/Circle/Circle.stories.js and save the file.
  • Expected behaviour:
    • Storybook will reload successfully with the same error as above.
  1. Modify /src/components/Circle/index.js, /src/components/Square/index.js, or /src/components/Square/Square.stories.js and save the file.
  • Expected behaviour:
    • Storybook will reload unsuccessfully with an eslint error for react-hooks/rules-of-hooks in both the terminal and the preview window.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published