Closed stpwin closed 5 years ago
when are you changing the src
? image already in the viewport or hasn't intersected?
when I called function
setState({
uploadedUrl: "IMAGE_URL"
});
so you want to change the image url after it's been lazy loaded?
if you change image url before been image been lazy loaded (hit intersection observer) that would work, but what's your case to change image after been lazy loaded? i don't get the use case here.
if you just want to change image by state, you should be ok with just normal img tag.
let me know your use case or code, we can work this out.
Yes I do. I want to change src when I uploaded new profile picture.
how about this approach:
Thank you!
please update codesandbox link, error 404.
i have same problem of image...
does not update the image when i change the props from my component
<SimpleImg height={300} src={this.state.uploadedUrl} />
when this.state.uploadedUrl change image not updated.