嘿大家我在这里遇到麻烦我的代码
我只想在我的项目中使用反应图标而不做其他事情
我只是在每个数据中显示图标正在渲染
像这样{ <${e.contact.icons}/>
}我在代码中所做的
import { FaBeer, Fa500Px, FaAccusoft } from "react-icons/fa";
// here is data for I want to show
const data = [
{
contact: [
{
title: "contact",
subtitle: "get in touch",
icons:"FaBeer",
},
{
title: "contact",
subtitle: "get in touch",
icons:"Fa500Px",
},
{
title: "contact",
subtitle: "get in touch",
icons:"FaAccusoft",
},
],
},
];
const contact = () => {
return (
<>
{data.map((e, i) => {
return (
<>
<div className="text-area">
<h1 className="title">{e.contact.title}</h1>
<h2 className="subtitle">{e.contact.subtitle}</h2>
<span> {`<${e.contact.icons}/>`} </span>
</div>
</>
);
})}
</>
);
};
export default contact;
{ <${e.contact.icons}/>
}这种类型的方法不起作用它在浏览器中像这样返回外部
<FaBeer/>
<Fa500Px/>
<FaAccusoft/>
这里的图标没有显示我应该怎么做