How to get Icons dynamically?
`....
import { Icon } from 'react-icons-kit'
import {facebook} from 'react-icons-kit/feather/facebook';
import {instagram} from 'react-icons-kit/feather/instagram';
import {twitter} from 'react-icons-kit/feather/twitter';
....
@juhamm you can import all the icons e.g. import featherIcos from 'react-icons-kit/feather
Object.keys(featherIcos) should give you the list, but do note you are going to be including this in your package
How to get Icons dynamically? `.... import { Icon } from 'react-icons-kit' import {facebook} from 'react-icons-kit/feather/facebook'; import {instagram} from 'react-icons-kit/feather/instagram'; import {twitter} from 'react-icons-kit/feather/twitter'; ....
// dynamic array from redux store "sociallinks": [ { "_id": 1, "type": "facebook", "linkname": "Facebook", "link": "https://www.facebook.com/zzzzz/" }, { "_id": 2, "type": "instagram", "linkname": "Instagram", "link": "https://www.instagram.com/yyy/" }, { "_id": 3, "type": "twitter", "linkname": "Twitter", "link": "https://twitter.com/xxx" }, { "_id": 4, "type": "youtube", "linkname": "Youtube", "link": "https://www.youtube.com/user/youtube" } ]
// problem is here how to markup icon = {xxxxx} from map item.type? item.lin and item.linkname woks fine..
{this.props.data.socialLinks.map((item,i) => (-
{item.linkname}
))
}
` .....