Import Svg Icons React. Stack overflow for teams is a private, secure spot for you and your coworkers to find and share information. The more complex the image the larger the svg file gets like we saw while trying to use the svg tag.here i will recommend you go with png or jpeg;
I've been working on a react project that uses custom svg icons and needed a nice way to import these icons. Import react, {component} from 'react'; I was running into an issue importing.svg files as react components in a typescript project.
Stack overflow for teams is a private, secure spot for you and your coworkers to find and share information.
When i was importing any *.svg files, the typescript compiler was erroring: Render icons in your react native project as svg code. I was running into an issue importing.svg files as react components in a typescript project. Import { reactcomponent as icon} from './icon.svg';