-
Hi, Is it possible to load icons dynamically in react? Something like : let Icon = icons[icon] and then Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
For anyone looking for solution, I created a gist for it: https://gist.github.com/aleyrizvi/036b05e948307c28affdb4e16045f2dc |
Beta Was this translation helpful? Give feedback.
-
The selected answer is not correct for me, the 1st solution loads all icons which is not optimized, the second one needs that we precise which icons to load which is not logical too because if we need to load the icons dynamically, we can not load them one by one before.. |
Beta Was this translation helpful? Give feedback.
For anyone looking for solution, I created a gist for it: https://gist.github.com/aleyrizvi/036b05e948307c28affdb4e16045f2dc