1import Image from 'next/image';
2export default function Home() {
3 return (
4 <div>
5 <Image
6 src='/assets/pexels-kendall-hoopes-6000x4000.jpg'
7 alt='universe'
8 width={1500}
9 height={1000}
10 />
11 </div>
12 )
13}
14
1yarn add next-images
2
3// add in next.config.js
4const withImages = require('next-images')
5module.exports = withImages()
6
7//where the image should go
8<img src={require('./my-image.jpg')} />
9//or
10import img from './my-image.jpg';
11export default () => <div>
12 <img src={img} />
13</div>
14