-
Notifications
You must be signed in to change notification settings - Fork 29.9k
Description
Bug report
Repeated [Next/Image] included images rerenders when switching between pages even if has been already used in components like layout/header.
Describe the bug
When including an image using next/image, in every page switch it rerender even if was rendered before, like a Header component with logo.
If we see the network tab in developer tooks, we can confirm that isn't a "thing" related to network/cache because the image/assets isn't downloaded multiple times.
Personally, actually don't know how exactly next/image works, but with the Gatsby equivalent (gatsby-image) it didn't happen using a similar "repeated component" approach.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
- Go to 'https://mhhk5.sse.codesandbox.io/'
- Click on 'Go to first page / Go to second page'
- Repeat multiple times step 2 quickly
Expected behavior
The image shouldn't rerender, and works like a normal .
System information
Not necessary, because was tested on Vercel, Codesandbox and my own PC
- OS: Windows 10
- Browser: Edge/Chrome Last version
- Version of Next.js: 10.0.1 / 10.0.2-canary.8 (Tested in both, same result)
- Version of Node.js: 14.7.0
PD: Sorry if my english isn't good enough.