2021-05-17 15:06:48 +02:00
# No Img Element
### Why This Error Occurred
2021-09-12 02:39:43 +02:00
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.
2021-05-17 15:06:48 +02:00
### Possible Ways to Fix It
Import and use the `<Image />` component:
```jsx
2021-06-16 08:57:45 +02:00
import Image from 'next/image'
2021-05-17 15:06:48 +02:00
function Home() {
return (
< >
< Image
src="https://example.com/test"
alt="Landscape picture"
width={500}
height={500}
/>
< />
)
}
export default Home
```
### Useful Links
- [Image Component and Image Optimization ](https://nextjs.org/docs/basic-features/image-optimization )