I am using FontawesomeIcon in a react js project and the names of the icons are coming from the database. I want to import the icons coming from the database from @fortawesome/free-solid-svg-icons dynamically
import React, { Component } from "react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import {faImage} from "@fortawesome/free-solid-svg-icons"; export class Features extends Component { render() { return ( <div id="features" className="text-center"> <div className="container-fluid"> <div className="features-listing"> {this.props.data.map((item, index) => ( <div key={`${index}`}> {" "} <FontAwesomeIcon icon={item.icon} /> <h3>{item.title}</h3> </div> ))} </div> </div> </div> ); } } export default Features;