React App creation
Introduction
React is a JavaScript library for building user interfaces. It enables developers to create reusable UI components.
-
Developed by Facebook
-
Component-based architecture
Steps to Create React app
You need to node.js and VSCode installed on your computer.
-
Install Yarn Go to command promt and install
npm install --global yarn
-
Run Below command
npm config set legacy-peer-deps true
It will resolve below Error npm error code ERESOLVE npm error ERESOLVE unable to resolve dependency tree
-
Create a folder in C:\ or D:
D:\Source\FSD-MERN\React-SamplesGo to (cd) React-Samples
-
To Create an React App
- Open
React-Samples
- Execute
npx create-react-app my-app
cd my-app
yarn - Open
-
To start an application it will open in the default browser
- Execute
yarn start
This completes the sample react app creation and running the app.
Issues
- Module not found: Error: Can't resolve 'web-vitals'
- Execute in Terminal
npm install --save-dev web-vitals