From b5eea97b809fb0748efa6f8a2f7535a13c8a900f Mon Sep 17 00:00:00 2001 From: Brandon Roberts Date: Tue, 17 Jan 2023 11:41:51 -0600 Subject: [PATCH] fix: add fix for Storbyook usage with Next 13 https://github.com/vercel/next.js/issues/36417#issuecomment-1117360509 --- .storybook/preview.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/.storybook/preview.js b/.storybook/preview.js index f42442aba..7b189f623 100644 --- a/.storybook/preview.js +++ b/.storybook/preview.js @@ -1,4 +1,16 @@ import '../styles/globals.css'; +import * as NextImage from "next/legacy/image"; + +const OriginalNextImage = NextImage.default; + +Object.defineProperty(NextImage, "default", { + configurable: true, + value: (props) => typeof props.src === 'string' ? ( + + ) : ( + + ), +}); export const parameters = { actions: { argTypesRegex: "^on[A-Z].*" },