This is only possible by utilizing the svgr npm module to render the component
<aside>
⚠️ This only works if you are either using VS Code, or have VSC Insiders aliased to code
</aside>
First you need to find an SVG on the internet
(I suggest SVGRepo for finding open-source SVGs)
Then right-click and “Copy Image Address”
Then you just need to paste the url into this command
curl "https://www.svgrepo.com/show/414849/education-library-metting.svg" \
| npx @svgr/cli \
| code -&
This should open up into a temporary file inside of VS Code
Once the generation is completed, it will create the SVG component right there in the editor
Done! 🎉
curl to grab it, and instead we can use cat to output the files contents directly to stdoutcat temp.svg | npx @svgr/cli | code -&
This should open up into a temporary file inside of VS Code
Once the generation is completed, it will create the SVG component right there in the editor
Done! 🎉