Templarian / MaterialDesign-React

Dist for Material Design Icons React Component for JS/TypeScript
https://materialdesignicons.com
MIT License
142 stars 20 forks source link

How to dynamically Import Icons? #28

Closed AthulNair closed 5 years ago

AthulNair commented 5 years ago

I want to load menu in my application which contains the name of the icon. But it is not showing because not imported. So how to import the icons dynamically and show it in an array

Templarian commented 5 years ago

https://github.com/Templarian/MaterialDesign-React/issues/26

There are several ways to do it, but the issue is you really do not want to include all the icons. It's very heavy. If you only need a few you can follow the advise in the issue above.

AthulNair commented 5 years ago

Great solution. Working perfectly. @Templarian

Templarian commented 5 years ago

Glad to hear. We'll work on documentation for this as it does come up once in a while.