State variable:-
const [picture, setPicture] = useState(null);
Let suppose picture="123" after updating image picture has same same value "123".So my question is how to reload Image.
<Image src={profileurl + picture} alt="profile" title="profile" width="100" height="100" />
I hope this function would be helpful. thanks
const reloadImg = url => {
fetch(url, {cache: 'reload', mode: 'no-cors'})
.then(() => document.body.querySelectorAll(`img[src='${url}']`).forEach(img => (img.src = url)))
.catch(e => console.log('error', e));
};