In NextJS,
I have an image component (next/image), which renders the URL which is in prop, but the URL is dynamic.
This means if the user clicks on ONE
the state changes to 1 so the URL changes, similarly for TWO
, THREE
, FOUR
, and FIVE
.
But the issue is, on state change the URL also changes but on UI it's reflecting after some time (load time). I need the image immediately load or at least disappear the previous image on URL change and load the whole image.
I don't want to render all image at first and display only one base on state because the page already exceeds DOM size.
Any technique to solve this issue?