Next.js introduced a new Image
component in v10 that's supposed to be a drop in replacement for the <img>
tag.
I'm having an error when trying to view components that import next/image
into Storybook:
TypeError: imageData is undefined
I have been trying to override the image object in preview.js
(a technique I use for next/router
, as documented here) but I get the same error:
// .storybook/preview.js
import Image from 'next/image';
Image = ({ src }) => <img src={src} />;
Any idea how I could override the behaviour of the next/image
package in Storybook?