How to dynamically import SVG and render it inline
You can make use of ref and ReactComponent named export when importing SVG file. Note that it has to be ref in order for it to work. The following examples make use of React hooks which require version v16.8 and above. Sample Dynamic SVG Import hook: function useDynamicSVGImport(name, options = {}) { const ImportedIconRef = … Read more