The breakthrough in technology has brought a whole new range of tool suite for developers to make the software development process more efficient. React App is among one of them! A prominent tool recommended by the React community to create single-page applications (SPAs) and also get familiar with React.
It is a prominent toolchain for building apps quickly and efficiently.
This blog will showcase how to create a React app from scratch.
Prerequisites to learn React
- Basic Knowledge of Node and npm
Virtual DOM : The most important and biggest feature introduced by React is Virtual DOM. In react, as a developer we work with Virtual DOM instead of working directly with Real DOM.
Components : : In react, every application UI is broken down into Components. Component is the most basic building block of the Application UI.
One-way data binding : React JS follows one-way data binding or unidirectional data flow that gives better control throughout the application.
Below are the steps which you have to follow to create you react project:-
- Download Node JS:- Download the latest setup of Node and install it.
- You can check the node version by using below command on Command Prompt:
- Install React App: Start creating react app by using below command.
npm create react-app my-app
- All setup is done. Now run `npm run start` command to see the result on the browser.
React project folder contains some initial files and folder which is as mentioned below.
- node_modules – This folder contains all the npm node and react libraries and dependencies which you are going to install to support project development.
- src – this folder going to contain main project files for code writing and content of web application.
- src/App.css – project css file.
- src/app.js – application component where we will write down UI rendering code.
- src/index.js – this file contains the root node for DOM rendering and DOM renderer react libraries and app.js component will be imported here and will be placed at the root node of DOM.
- Index.js will be the starting point of application and it will call all the initial root component which is app.js in this case and default also in basic project templates.
- React web application will be a combination of multiple components and will form a good structured UI.