JSFiddle - React, Tailwind, and code Playground
HTML
<svg id='svg' style='width: 400px; height: 400px;'>
</svg>
JavaScript
var svg = d3.select('#svg');
var mySquare=svg.append("rect")
.attr("x",60)
.attr("y",60)
.attr("width",60)
.attr("height",60)
.style("fill","blue");
mySquare
.transition()
.duration(1000)
.attr("x",320);