DEV Community

Vishnu Priya S
Vishnu Priya S

Posted on

React

-> React is a popular open-source JavaScript library developed by Meta (Facebook) used for building interactive user interfaces (UIs), specifically for single-page applications.

-> React has rule of self closing tag.

Components: The building blocks of a React application. They are self-contained, reusable pieces of UI code (eg: )

JSX (JavaScript XML): A syntax extension that allows you to write HTML structures directly inside your JavaScript code.

VirtualDOM: React takes the copy of Original DOM to Virtual DOM when changes occurs to update the changes only to the specific parts of the webpage that changed instead of refreshing the entire page.

State: When state updates, React automatically re-renders the component to refresh the UI

syntax: import { useState } from 'react';

const [state, setState] = useState(initialValue);

  1. state - current value
  2. setState- function use to update the variable
  3. initialValue- The starting value (can be a number, string, boolean, array, or object)

XML - Exsentible Markup Language
a flexible, W3C- World Wide Web Consortium-standardized text format designed to store, transport, and structurally organize data across different hardware and software platforms.

Top comments (0)