React Installation or Setup
Installing via npm
You can also install React using npm by doing the following:
npm install --save react react-dom
Installing via Yarn
Facebook released its own package manager named Yarn, which can also be used to install React. After installing Yarn you just need to run this command:
yarn add react react-dom
You can then use React in your project in exactly the same way as if you had installed React via npm.