JSFiddle - React, Tailwind, and code Playground

HTML

<div class="img-spoiler">
<button>Schowaj/Pokaż</button>
<img src="http://placehold.it/350x25" alt="image">
</div>

<div class="img-spoiler">
<button>Schowaj/Pokaż</button>
<img src="http://placehold.it/350x25" alt="image">
</div>

CSS

.img-spoiler img {
  display: none
}

JavaScript

$( ".img-spoiler" ).click(function() {
  if( $(this).children( "img" ).css('display') == 'none' ){
    $( this ).children( "img" ).show();
  } else {
    $( this ).children( "img" ).hide();
  }
});