如何使用React使用FA-Light图标
我如何使用反应的字体引人入胜的图标?
<FontAwesomeIcon icon={faEnvelope} size="2x" />
如果我使用坚固的图标,我的代码仅能工作。
谢谢。
how do I use font-awesome light icons with React?
<FontAwesomeIcon icon={faEnvelope} size="2x" />
My code only work, if I use solid icon.
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道这无济于事,但是要在React中使用Light版本,您只需要一个Pro帐户,如Pro部分所示( https://fontawesome.com/docs/web/use-with/react/ )
您首先必须下载依赖项
npm i -save @fortawesome/pro-light-svg-icons
,但仅适用于Pro版本,对于免费版本,您必须使用cdn的字体HTML或使用图像。下载后,只需导出您想要的图标:
I know it doesn't help, but to use the light version in react, you only need a Pro account, as shown in the Pro section at this URL (https://fontawesome.com/docs/web/use-with/react/)
First you will have to download the dependency light
npm i --save @fortawesome/pro-light-svg-icons
but it is only for the Pro version, for the free versions you will have to use the font by the CDN in the html, or use a image.After downloading just export the icon you want: