I\'m getting following error when trying to load svg as ReactComponent.
Element type is invalid: expected a string (for built-in components) or a class/fu
TLDR: import MySvg from "MySvg.svg" then
import MySvg from "MySvg.svg"
To import an SVG: import MySvg from "MySvg.svg" which will save the path as a string inside MySvg.
MySvg
To render it, use an img tag as in standard HTML, since MySvg is actually a path:
The reason you get undefined is that you are destructuring a string.