【问题标题】:Icon is not exported from react-icons and compiler error is shown图标未从 react-icons 导出,并显示编译器错误
【发布时间】:2021-11-24 02:26:55
【问题描述】:

我安装了 react-icons 但它不起作用

错误:FaBeer 未导出

import '../style/mobHeader.css'
import { FaBeer } from 'react-icons/fa';
const Mobileheader = () => {
    return (
        <div className="mob-header">
            <h3>LoremIPSUM</h3>
            <h3>LoremIPSUM </h3>
            <FaBeer />
   
        </div>
    );
}```

【问题讨论】:

  • 你的导入语法看起来不错,你应该检查包是否安装成功,你能在你的模块文件夹中找到包吗?
  • 是的,包在那里..我在 node_modules 中检查了它

标签: javascript reactjs react-icons


【解决方案1】:

从昨天开始也有这个问题。似乎与最新版本(v4.3.0)有关。

您现在可以安装以前的版本 (v4.2.0),直到找到合适的解决方案:

npm install react-icons@4.2.0 --save

【讨论】:

    猜你喜欢
    • 2019-04-27
    • 1970-01-01
    • 1970-01-01
    • 2021-09-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多