REACT

 REACT



What is React?

  1. React is one of the most popular JavaScript libraries for building user interfaces, especially for web applications.
  2. React was created by Facebook to make it easier to build dynamic and interactive web pages.
Before React managing updates and changes in web pages was complicated and slow. When using React, it makes this process faster and more efficient.

React Key Features:

  1. JSX
  2. Virtual DOM
  3. Component-based Architecture
  4. One-Way Data Flow

What is JSX?

  1. It's a syntax extension for JavaScript that looks like HTML.
  2. JSX allows you to write HTML-like code in JavaScript files and display dynamic information. It is easier to create components and make your code clearer and more readable.

What is a DOM?

  1. The DOM is needed to organise and access elements on a webpage.
  2. DOM is a JavaScript object that contains all the elements you have in the HTML, like paragraphs, kinks, lists, and others.
  3. The DOM allows use JavaScript to find, add, update, and delete elements without reloading the page.
  4. It updates the webpage immediately, but it can be slow when many changes happen at the same time.

What is a Virtual DOM?

  1. The virtual DOM is a lightweight copy of the real DOM.
  2. Virtual DOM helps update web pages faster because it groups changes together and reduces extra work.
  3. All changes in React are first applied to the virtual DOM. Then React compares the Virtual and Real DOMs, identifies differences, and updates only the changed elements in the Real DOM.

What is Component-Based Architecture?

  1. It's a way of building interfaces by breaking them down into small pieces called components, such as a button or a form.
  2. Component-based architecture makes it easier to build complex applications. That's because it's made up of small pieces of code called components, which helps keep code organized and reusable. 
                            e.g., menu, banner, product, etc.
     3. Each Component can have its own State and Behaviour.

What is One-Way Data Flow?

  1. It means that data goes only from parent to child components.
  2. One-way data Flow is needed to keep data flow simple and easy to manage.
  3. But child components can't change the data directly. They must request the changes from the Parent through Events.

0 Comments