Member-only story
React Virtual DOM
How to create a React Application?
How to Create an Application? React is a JavaScript front-end library sometimes called a framework. React is used to create complex UI, React is used to create reusable UI components, used for single-page applications. Now the question arises: How to create a React Application and how does React create their virtual DOM?
How does HTML work
Before jumping into react let’s understand how browsers process HTML
When we upload our HTML page, the browser:
1: Read the HTML file line by line.
2: Convert the HTML code into a DOM tree ( Document object model )
3: This tree represents the structure of the web page. like below in the image.
Browser DOM
Getting started
working on React we need JavaScript run time environment Node.js. first, we install it( install it from the Node.js website). than create a React application by using the following command in the terminal of VS Code.
// This will create the React App. Here! there are the following folder and files
npx create-react-app my-app-name
// This will run the React App.
npm start run