Closed veighthedev closed 3 years ago
Update: Made it using the old url-loader options in addition to the SVG loader
Do I understand correctly that with this change, the default behavior does not change for existing projects? And that only if you use the named import explicitly you'll have the new behavior?
@loopmode yeah, the svg can still be imported as a url string, like it was before.
Example:
import starUrl, { ReactComponent as Star } from './star.svg'
const App = () => (
<div>
<img src={starUrl} alt="star" />
<Star />
</div>
)
Added svgr as a loader for SVGs which allows you to import SVGs as Components.
https://react-svgr.com/docs/webpack/