noaignite / create-ignite-app

Boilerplate for React with Next.js and MUI
17 stars 2 forks source link

fix(storybook): add NextRouter addon #88

Closed adamsoderstrom closed 1 year ago

adamsoderstrom commented 1 year ago

Current Behavior

Consuming the useRouter hook in Storybook results in an error.

In the image below, i consume the useRouter hook in the Hero.js block.

image

Expected behavior

The stories render, but shouldn't necessarily implement the NextRouter functionality.


This is solved in this PR via the "Next.js router Addon", from Storybook.

maeertin commented 1 year ago

Awesome @adamsoderstrom!! 🔥 I'll merge this into develop and create a release.