Skip to content

Commit

Permalink
Adding hack for loading next/image into sanity-next
Browse files Browse the repository at this point in the history
  • Loading branch information
weotch committed Sep 9, 2024
1 parent 991a97e commit 4efe097
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/next/src/NextVisual.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import Image from 'next/image'
// `next/image` as importing as { default: Image, __esmodule: true } when
// this file was loaded by @react-visual/sanity-next. This is my hack to fix
import _Image from "next/image";
const Image = ("default" in _Image ? _Image.default : _Image) as typeof _Image;

import type { ReactElement } from 'react'

import { makeImagePlaceholder } from './lib/placeholder'
Expand Down

0 comments on commit 4efe097

Please sign in to comment.