Skip to content

Commit

Permalink
fix: add fix for Storbyook usage with Next 13
Browse files Browse the repository at this point in the history
  • Loading branch information
brandonroberts committed Jan 17, 2023
1 parent f6e30e1 commit b5eea97
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -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' ? (
<OriginalNextImage {...props} unoptimized blurDataURL={props.src} />
) : (
<OriginalNextImage {...props} unoptimized />
),
});

export const parameters = {
actions: { argTypesRegex: "^on[A-Z].*" },
Expand Down

0 comments on commit b5eea97

Please sign in to comment.