JSFiddle - React, Tailwind, and code Playground
HTML
<button id="btn">
Reload
</button>
<img id='img' src="https://www.import.io/wp-content/uploads/2017/10/React-logo-1.png" />
CSS
canvas {
border: solid 1px black;
}
JavaScript
document.getElementById('btn').addEventListener('click', () => {
const oldImg = document.getElementById('img')
oldImg.parentElement.removeChild(oldImg)
setTimeout(() => {
const img = document.createElement('img')
img.setAttribute('crossOrigin', 'anonymous')
img.src = "https://www.import.io/wp-content/uploads/2017/10/React-logo-1.png"
document.body.appendChild(img)}, 700)
})