Consider:
import LOGO from './something.svg';
<img src={LOGO} className={'logo'} alt="Logo"/> //
How can I change fill color of SVG in ReactJS ?
I've tried also to use ReactComponent but I got 'ReactComponent' is not exported from ....
import { ReactComponent as Logo1 } from './something.svg';
<Logo1 /> // doesn't work : 'ReactComponent' is not exported from ....
In your jsx:
import { ReactComponent as Logo } from './something.svg';
const MyComponent = () => <Logo className="logo" />
in your css:
.logo > path {
fill: "white"
}
This should work just fine
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With