I've done my previous 2 projects with React and had used Sass files for styling the components. But in this project it's getting a bit confusing because I've to use SVGs for my images. Now I'm stuck at styling SVGs with Sass files.
Here's the codesandbox including just the navbar component where I want to change the color of logoBookmark
svg.
I don't want to paste the whole xml stuff. So I import the SVG straight away
import logoBookmark from "../../images/logo-bookmark.svg"
,
and set src={logoBookmark}
for img
tag.
To style external SVGs, I found this simple solution on stack overflow.
But I don't know how implement to this in React where I've a Sass file which is further imported in a JSX file.
So could someone please share the optimal solution for this problem?