I have a list of URLs to images. Each of these images sometimes load and sometimes 404 (meaning that an image that loaded at some point may disappear later).
let images = ['http://example.com/img1.jpg', ...];
Is there a way to request these images, to save them in memory if the request is successful, and to display those saved images in React?
componentDidMount() {
this.setState({ savedImages: images.map(saveImage)} );
}
render() {
return (
<div><image src={this.state.savedImages[0]}/></div>
);
}