Answer the question
In order to leave comments, you need to log in
How to correctly set the path to the icon in the background-image using styled-components, React and Parcel?
I use React, Parcel, styled-components.
I want to inline the icon in the background-image that is in the assets folder.
background-image: url('../../assets/images/check.svg');
- doesn't work like thatimport img from '../../assets/images/check.svg';
...
background-image: url(${img});
- so too, in the background-image inspector: url([object Object]) Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question