Help us understand the problem. What is going on with this article?

RailsのReactでfont-awesomeを導入

More than 1 year has passed since last update.

すぐ忘れるので個人用メモです。

詳しくはこのサイトを見てもらったほうが早いです。↓
FortAwesome/react-fontawesome-github

yarnでのインストール

$ yarn add @fortawesome/fontawesome-svg-core
$ yarn add @fortawesome/free-solid-svg-icons
$ yarn add @fortawesome/react-fontawesome
import ReactDOM from 'react-dom'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' #1
import { faCoffee } from '@fortawesome/free-solid-svg-icons' #2

const element = <FontAwesomeIcon icon={faCoffee} /> #3

ReactDOM.render(element, document.body)

コンポーネントに#1〜3を追加するとコーヒーのアイコンが出ます。

sakakinn
主にRailsについて記事を投稿しています。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away