rsnext/errors/no-img-element.md
Ivan Kalinin c851da25f4
Fixed no-img-element documentation snippet. (#26154)
Module "next/image" has no exported member 'Image'.
It must be `import Image from "next/image"`
2021-06-16 08:57:45 +02:00

647 B

No Img Element

Why This Error Occurred

An HTML <img> element was used to display an image. For better performance and automatic image optimization, use Next.js' built-in image component instead.

Possible Ways to Fix It

Import and use the <Image /> component:

import Image from 'next/image'

function Home() {
  return (
    <>
      <Image
        src="https://example.com/test"
        alt="Landscape picture"
        width={500}
        height={500}
      />
    </>
  )
}

export default Home