I'm trying to render 2 SVG files on my react app.
Here:
But when importing it as a component to React:
import { ReactComponent as ClosedEnvelope } from "../../close.svg";
import { ReactComponent as OpenEnvelope } from "../../open.svg";
const Envelope = ({closed) => {
return (
<div>
{closed ? <ClosedEnvelope /> : <OpenEnvelope />}
</div>
);
};
It renders the SVG incorrectly:
As you can see the "arrow" on the bottom left side is overflowing.
Seems like an issue with the method I used, because loading the SVG as an image, does work.
What may the problem be? Thanks in advance
Here are the links to the SVG files: Close envelope Github Open envelope Github
Well, Apparently the 2 SVG files, had the same classes and IDs, which caused them to change a little.
If you have the same issue,
clip-path: URL(#SOME_ID)
This worked for me.