![](/img/trans.png)
[英]Font Awesome 5 icons not working with React (“Could not find icon” error)
[英]React Native font awesome regular icon could not be found within the project
我在 React Native 中使用很棒的字體圖標,如下所示:
import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome"
import { faArrowLeft } from "@fortawesome/free-solid-svg-icons/faArrowLeft"
import { faPlus } from "@fortawesome/free-solid-svg-icons/faPlus"
...
<FontAwesomeIcon icon={faArrowLeft} size={50} />
...
我想在導入中將“solid”更改為“regular”。 我已經完成了npm i --save @fortawesome/free-regular-svg-icons
。 我得到@fontawesome/free-regular-svg-icons/faArrowLeft could not be found within the project or in these directories: node_modules
。
import { faArrowLeft,faPlus } from "@fortawesome/free-solid-svg-icons"
我使用 FontAwesome 已經有一段時間了。我認為這是正確的語法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.