Thumbnails do not update with images when state changes.
See original GitHub issueI am polling an endpoint for new images using a setInterval() function.
Every interval I set the state of a responses array.
render(){
return (
<Carousel
selectedItem={this.state.selectedItem}
onClickThumb={this._onClickThumb.bind(this)}
>
{
this.state.responses.map(function(url){
return <img src={url} key={url} />
}
)
}
</Carousel>
)
}
}
When I get a new image, the image is present in “ul.control-dots” but not in the thumbs.
The thumbs do not update along with the changing images.
Is there a way to refresh the thumbs when I add or remove images?
Issue Analytics
- State:
- Created 6 years ago
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Image thumbnails will not update - Microsoft Community
1. Open Windows Explorer · 2. Click on Options and Change folder and search options · 3. Next, click on the View tab...
Read more >Fix Windows 10 Picture Thumbnails Not Showing
Click Apply and OK. Windows 10 image thumbnails not showing problem should resolve now. Method 3: Change Visual Effect Settings of Windows 10....
Read more >React hooks not updating state for array of images on click event
At the moment the active slide and index is both being passed to the function correctly. However the activeSlide in state doesn't update....
Read more >Solved: Thumbnail update fails - Esri Community
I go to the details page, click on edit, and then on the thumbnail picture to change it. It states the size should...
Read more >Thumbnail not updated [#2749695] | Drupal.org
When I change an image file to a media entity of type image, the thumbnail is not updated. First I noticed this when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Another workaround is to set a key against the carousel component that corresponds to the images. In my case the images were small number so I stringify the images list. This causes a change in images to render a new carousel component and destroy the old one.
Weirdly, this issue still happens for me. The slider images gets updated, but not the thumbs. I have gone through the PR, but couldn’t find the solution.
Update: I was able to override this with forceUpdate based on some other props on the page