How should I use icons? I want to use icons on my website but the catch is I want them conditional like I want to add social links and I only want icons I’ve in the state like:
But I want if I’ve to add/remove a social link I haven’t to add it manually in code but simply change it in the state.
Like I can do that using font awesome library like:
But this is the ugly method of loading the whole CDN library and the other method is I simply add svg code here still looks bad and prohibited in docs that state size shouldn’t be big.
Here’s a couple of approaches. Font Awesome allows you to create subsets of icons to reduce file size and even just import the icons you need into your project. Take a look at:
TY for help.
I wanted something like dynamic imports for icons based on theme config in index.js.
I found https://react-icons.netlify.com/ very helpful.
But idea like dynamic imports isn’t cool now.