From 9ff9eeb923402225f578e09bcc560c40de06371c Mon Sep 17 00:00:00 2001 From: Kamigami55 Date: Wed, 13 Oct 2021 23:47:52 +0800 Subject: [PATCH] Mock Next.js in storybook https://github.com/vercel/next.js/issues/18393#issuecomment-783269086 --- .storybook/preview.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.storybook/preview.js b/.storybook/preview.js index 83b2639..d045310 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -12,3 +12,12 @@ export const parameters = { default: 'light', }, } + +// Mock Next.js component in storybook +// https://github.com/vercel/next.js/issues/18393#issuecomment-783269086 +import * as NextImage from 'next/image' +const OriginalNextImage = NextImage.default +Object.defineProperty(NextImage, 'default', { + configurable: true, + value: (props) => , +})