Import SVGs as React Components | How to code Tutorial

Veröffentlicht am: 28 August 2021
auf dem Kanal: Dev Done
7,042
60

Hi everyone, welcome to Dev Done.

⭐️ Topic ⭐️
importing SVGs as react components using create react app.

⭐️ The Why? ⭐️
Svgs today are an integral part of web development giving abilities scale images without losing the quality.
Importing SVG files as img tags have a few limitations.

⭐️ The Advantages? ⭐️
✔️ Size reduction: The conversion to ReactComponent is smaller than the SVG itself.
✔️ Since it's a component, therefore, easy to use and handle and rendered inline therefore we can control it easily.
✔️ SVG images bundled with JS, therefore no extra fetch browser calls, not even SVG Sprites needed.
✔️ Converting SVG to a component can be helpful in customizing the images.

⭐️ Resources ⭐️
Create React App - https://reactjs.org/docs/create-a-new...
SVGR library - https://react-svgr.com/playground/


Auf dieser Seite können Sie das Online-Video Import SVGs as React Components | How to code Tutorial mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Dev Done 28 August 2021 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 7,042 Mal angesehen und es wurde von 60 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!