Replies: 2 comments
-
An update to this issue - I also have a case where I need to use ref for |
Beta Was this translation helpful? Give feedback.
0 replies
-
I'm working on |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Describe the feature you'd like to request
Would be nice if next/image would forward refs to
<img/>
or provide more data like the url inonLoadingComplete
. I have a case where I load the same image twice:The thing is that background image uses CSS's
background-image: url("...")
. I'd like to reuse cached image that was loaded initially, but there's no way to get this data from event or even access the refDescribe the solution you'd like
Either forward the ref (I don't see an issue here + it would stop issues similar to this popping up from time to time) or add url to data given to
onLoadingComplete
callbackDescribe alternatives you've considered
For now I'm using a workaround like
`/_next/image?url=${encodeURIComponent(url)}&w=1080&q=75`
Which I'd really like to remove.
Also, to note, this is an edge case where I can't just use a regular url in CSS. I have to reuse the cached data or the image won't load.
Beta Was this translation helpful? Give feedback.
All reactions