How to import an entire folder of SVG images (or how to load them dynamically) into a React Web App?

前端 未结 5 1691
挽巷
挽巷 2021-02-05 05:02

I have a component that takes in an :itemName and spits out an html bundle containing an image. The image is different for each bundle.

Here\'s what I have:



        
5条回答
  •  南笙
    南笙 (楼主)
    2021-02-05 05:44

    Best way is to use a node module like [SVG to React Loader] (https://github.com/jhamlet/svg-react-loader)

提交回复
热议问题