svgr: import xx from 'path/xx.svg' Error
test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, use: [ { loader: '@svgr/webpack', options: { icon: true } } ]

import logoSvg from 'paths/logo.svg';
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (4 by maintainers)
you need to add a
svg.d.tsto your project like this:and it should work as expected (although I’m not sure if the props will actually be passed down to the SVG that is about to be inlined, if it doesn’t, change
SVGPropstoany)So - you don’t need to compile it to typescript if you are using webpack-loader - for TS it still SVG and nothing more.
It worth to use only if you are pre-compiling these images.