JSFiddle - React, Tailwind, and code Playground

HTML

<svg>
  <image xlink:href="https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/gallardo.svg" />
</svg>

CSS

svg
{
  outline: 1px solid green;
}

JavaScript

var svg = document.getElementsByTagName("svg")[0];
var bbox = svg.getBBox();

svg.setAttribute("viewBox", "0 0 " + (bbox.width) + " "+(bbox.height));

//// if we need to fix dimensions we can do that
// svg.setAttribute("width", (bbox.width)  + "px");
// svg.setAttribute("height",(bbox.height) + "px");