JSFiddle - React, Tailwind, and code Playground
HTML
<input id="img-switcher" type="checkbox"></input>
<label for="img-switcher"></label>
CSS
#img-switcher {
width: 0px;
height: 0px;
visibility: hidden;
position: absolute;
}
#img-switcher + label {
background-image: url('http://i.imgur.com/6enLqgn.jpg8');
width: 100px;
height: 100px;
display: block;
background-size: cover;
}
#img-switcher:checked + label {
background-image: url('http://i.imgur.com/dBIRe8n.jpg?1?4649');
}