Reactの環境設定

Tuyoshi Akiyama
Jul 21, 2017 · 2 min read

以下の記事を参考に、まとめていきます。

create react appを使って環境設定を行うので、かなり簡単行うことができます。

ターミナルを開いて、以下コマンドをうちます。

npm install -g create-react-app 
create-react-app my-app
cd my-app
npm start

ブラウザ上でlocalhost:3000でアプリが起動していたら、インストールは成功です。

create-react-app自体の設定はreadmeも合わせて読んでみました。

.eslintrcファイルに以下のコードを追記

{
"extends": "react-app"
}

また、prettierをインストールして、自動的にコードのフォーマットを整えてくれるパッケージを入れました。

yarn add husky lint-staged prettier

その他にCSS Preprocessor(Sass)やテストの書き方等、

便利そうな各種機能の解説が書かれています。

)
Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade