Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add img in next.js

yarn add next-images

// add in next.config.js
const withImages = require('next-images')
module.exports = withImages()

//where the image should go
<img src={require('./my-image.jpg')} />
//or
import img from './my-image.jpg';
export default () => <div>
  <img src={img} />
</div>
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged: #add #img
ADD COMMENT
Topic
Name
7+6 =