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

Image component doesn't rerender #77

Closed
ingojoseph opened this issue Mar 21, 2015 · 5 comments
Closed

Image component doesn't rerender #77

ingojoseph opened this issue Mar 21, 2015 · 5 comments

Comments

@ingojoseph
Copy link

<Image src={src} />

If I change the variable src the image doesn't update. Is this a bug?

ingojoseph added a commit to ingojoseph/react-canvas that referenced this issue Mar 29, 2015
Update image props on re-render. Flipboard#77
@benjamingeorge
Copy link

I have a similar problem and I'm wondering if I'm missing something. When I change the src on an image component via a state change, it doesn't rerender on the canvas. Isn't this the expected behavior or no?

@ingojoseph
Copy link
Author

@benjamingeorge Yes, if you change the state, all components should update. That's the common behavior of React components.

You can try to use my fix but I just noticed that it's not working perfectly if the image is not loaded already.

@benjamingeorge
Copy link

Yes your fix works for me but only if the images are preloaded by placing them in the DOM in img tags.

@mattrei
Copy link

mattrei commented Aug 31, 2015

Is it possible to fix this bug somehow? Such a showstopper for me.
Thanks

@singggum3b
Copy link

+1, you can workaround by using src (or a hash of src) as key

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

Successfully merging a pull request may close this issue.

5 participants