I'm using file loader and can load pngs just fine. I'm doing import myImage from "../../path/image.svg"
and then <img src={myImage}/>
. When I use the developer tools and click on the SVG I'm trying to include, I get a page with a message like:
"Error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error."
Has anyone seen this error before and if so what can be done about it?
我发现了@svgr/webpack ,有了它,您可以像模块一样导入SVG ,然后将它们用作组件。
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.