简体   繁体   English

在项目中找不到 React Native font awesome regular icon

[英]React Native font awesome regular icon could not be found within the project

I am using font awesome icons in react native like so:我在 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} />
...

I want to change the "solid" to "regular" in the imports.我想在导入中将“solid”更改为“regular”。 I have done npm i --save @fortawesome/free-regular-svg-icons .我已经完成了npm i --save @fortawesome/free-regular-svg-icons I get @fontawesome/free-regular-svg-icons/faArrowLeft could not be found within the project or in these directories: node_modules .我得到@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"

It has been awhile im using FontAwesome.I think this is the correct syntax.我使用 FontAwesome 已经有一段时间了。我认为这是正确的语法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM