Blog hero
Nov 10, 2020

How to fix Invalid hook call error on Storybook React v6 upgrade

Recently I've been trying to upgrade my next-js-boilerplate repository dependencies. I've successfully upgraded React, Next.js and Apollo Client, however I've had an issue with Storybook v6 upgrade.

There was no error shown on storybook startup, but when I try to navigate http://localhost:6006 on my browser there was only a blank page displayed. When I checked the error on developer console, I've seen an Invalid hook call error. I've just a simple hello world story and it wasn't possible that my component caused the error. Then I started to google the issue and find out that the problem happens on storybook v6.0.x with React 17.x.

This is the issue on storybook repository.

The issue is fixed on v6.1-beta version as it's stated on the comment here

It's enough to just upgrade storybook version to fix the issue.