I have an svg file which I want to display on my website. The svg has a linearGradient but when I add it to my code and display it, I only see the svg black without the lineargradient which is defiend.
So in my vite.config.ts file I imported the svgr import { defineConfig } from 'vite' import react from '@vitejs/plugin-react' import svgr from "vite-plugin-svgr";
I created a svgr.config.js file with the content below // svgr.config.js module.exports = { svgoConfig: { plugins: { removeViewBox: false, }, }, }; Afterwards I import it and display it in my div import { ReactComponent as Logo } from "../assets/svg/logo.svg"