Looking for a solution involving a React Native Component that requires an image URI as a prop? The prop is passed from another js file using the code snippet below:
<SlideComponent
imageUri={listOfAssets[counter].uri}
/>
The approach of passing the image URI dynamically may not be the most ideal, but it gets the job done. However, there's a catch - as the counter increases to provide a new image URI, the image fails to update within the "SlideComponent".
Here's how the counter variable is being updated:
const keepImage = async () => {
counter = counter + 1;
};
Is there a workaround or method to force a re-render of the Component each time the counter increments?