JSFiddle - React, Tailwind, and code Playground
HTML
<svg>
<g>
<rect class="box" x="30" y="30" width="60" height="60" stroke="black" stroke-width="1" />
</g>
</svg>
CSS
.box {
fill: none;
pointer-events: all;
}
.box:hover {
fill: red;
}