React components can be generated from SVG files using https://github.com/smooth-code/svgr.
Suppose you have the following icons:
src/
└── icons
├── foo.svg
└── bar.svgRunning npx @svgr/cli -d src/icons src/icons will generate the corresponding React components:
src/
└── icons
├── foo.svg
├── foo.js
├── bar.svg
└── bar.jsThese can be imported:
import Foo from "./foo.js";