I have a Component in which the background changes every 5sec. The way I've implemented there is a small delay between images being loaded. I am looking for a way to prefetch the images upon the component mounting instead of when the URL state changes.
componentDidMount(){
setInterval(() => {
let nextStorie = this.state.currentStory + 1
this.setState({ url: this.state.listOfUrls[nextStorie].url, currentStory: nextStorie })
}, 15000)
}
return (
<ImageBackground source={{ uri: this.state.url }}>
<Content />
</ImageBackground>
)