DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Muhammad Bilal Mohib-ul-Nabi
Muhammad Bilal Mohib-ul-Nabi

Posted on

Rendering Local/Static Images in Next JS

To render a static image in Next JS.

  1. Always store images in the folder called public under the src directory.
  2. To render an image if image name was img.png.Then it will be available like this.
<img src={`img.png`} alt="Person Avatar" />
Enter fullscreen mode Exit fullscreen mode

Thats it.
For more info
Original Source

Top comments (0)

In defense of the modern web

I expect I'll annoy everyone with this post: the anti-JavaScript crusaders, justly aghast at how much of the stuff we slather onto modern websites; the people arguing the web is a broken platform for interactive applications anyway and we should start over;

React users; the old guard with their artisanal JS and hand authored HTML; and Tom MacWright, someone I've admired from afar since I first became aware of his work on Mapbox many years ago. But I guess that's the price of having opinions.