Suspend While Images Load
Unanswered
Carpenter wasp posted this in #help-forum
Carpenter waspOP
I'm fetching data in a server component within a Suspense boundary and passing it to a client component which renders some images.
How can I continue to suspend the component until the images have loaded? It should render if the images are in the browser cache or suspend for another second or so if they have to be downloaded. I'm struggling to do this with Next/Image.
The onLoad and onLoadingComplete events don't seem to fire when I attempt to suspend the component manually. I'm not sure what the best approach is. I believe they have to be rendered somehow in which case I can't have them in a suspense boundary. If they were regular images I could preload the SRCs but I don't know the SRC with next/image.
How can I continue to suspend the component until the images have loaded? It should render if the images are in the browser cache or suspend for another second or so if they have to be downloaded. I'm struggling to do this with Next/Image.
The onLoad and onLoadingComplete events don't seem to fire when I attempt to suspend the component manually. I'm not sure what the best approach is. I believe they have to be rendered somehow in which case I can't have them in a suspense boundary. If they were regular images I could preload the SRCs but I don't know the SRC with next/image.