Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing reactivity for src prop in UnLazyImage #52

Open
talaxasy opened this issue Jun 10, 2024 · 4 comments
Open

Missing reactivity for src prop in UnLazyImage #52

talaxasy opened this issue Jun 10, 2024 · 4 comments

Comments

@talaxasy
Copy link

Reproduction

Reproduction link: link

Insert any image from the ones provided, for example Ivan Grozny, and click on the "Update Image" button.
The image is expected to change.
In fact, what happens is that the image remains the same

Describe the bug

After reactively changing the image URL, the UnLazyImage component does not render the new value inside the src prop.

Additional context

image

Logs

No response

@felixranesberger
Copy link
Contributor

I looked into the source code and I think this is not implemented at the moment.
You can probably use :key="currentImageUrl" to force a re-render of the whole component and its lazy loading functionality when the value changes.

@johannschopplich
Copy link
Owner

Great catch! Yeah, the reactiveness is missing at the moment… PR welcome!

@johannschopplich johannschopplich changed the title UnLazyImage component doesn't display new image after reactively changing :src prop Missing reactivity for src prop in UnLazyImage Jun 18, 2024
@talaxasy
Copy link
Author

Yes, I already use :key for rerendering, can we consider the issue closed?

@johannschopplich
Copy link
Owner

Please leave it open. Technically speaking, it's a bug and everyone rightfully can expect props to be reactive. 😌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants