Difference between revisions of "React Setup"

From rbachwiki
Jump to navigation Jump to search
Line 4: Line 4:
  npm install react react-dom
  npm install react react-dom
  npm install @babel/core babel-loader @babel/preset-env @babel/preset-react
  npm install @babel/core babel-loader @babel/preset-env @babel/preset-react
npm install webpack webpack-cli webpack-dev-server
code . # will open visual studio code in that directory
  npx create-react-app my-app # this does not install it globally
  npx create-react-app my-app # this does not install it globally
  cd my-app
  cd my-app

Revision as of 19:04, 10 February 2021

  • Install Node
  • React dev tools for Chrome (optional)
npm init -y # 
npm install react react-dom
npm install @babel/core babel-loader @babel/preset-env @babel/preset-react
npm install webpack webpack-cli webpack-dev-server

code . # will open visual studio code in that directory

npx create-react-app my-app # this does not install it globally
cd my-app
npm start

Check if npm is installed

npm --version