REACT
VIMALGANTH DURAISAMY
150+ Leetcode Problem Solving | Java | Python | Data Analytics & ML Buff | Front-End Developer (HTML, CSS, JS, React) | Salesforce APEX, LWC | Google Cloud Platform
React is a powerful JavaScript library for building dynamic and interactive user interfaces (UIs). It is developed by Facebook. React is known for its component-based architecture which allows you to create reusable UI elements, making complex web applications easier to manage and maintain. React is used to build single-page applications.
Basic Example of React:
import React from 'react';
import ReactDOM from 'react-dom/client';
function Hello(props) {
return <h1>Hello GeeksforGeeks</h1>;
}
const container = document.getElementById("root");
const root = ReactDOM.createRoot(container);
root.render(<Hello />);
This code defines a functional component named App that returns JSX code displaying the text “Hello GeeksforGeeks”. Save the file and run your development server using npm start. Navigate to https://localhost:3000/ in your browser to view your webpage.
Why Learn React JS?
React, the popular JavaScript library, offers several exciting reasons for developers to learn it.
First, React is flexible – once you learn its concepts, you can use it across various platforms to build quality user interfaces. Unlike a framework, React’s library approach allows it to evolve into a remarkable tool.
Second, React has a great developer experience, making it easier to understand and write code. Third, it benefits from Facebook’s support and resources, ensuring regular bug fixes, enhancements, and documentation updates. Additionally, React’s broader community support, excellent performance, and ease of testing make it an ideal choice for web development.
Features of React
1. JSX (JavaScript Syntax Extension):
Example:
领英推荐
const name = "GeekforGeeks";
const ele = <h1>Welcome to {name}</h1>;
2. Virtual DOM (Document Object Model):
3. One-way Data Binding:
4. Performance:
5. Extension:
6. Conditional Statements in JSX:
Example:
const age = 12;
if (age >= 10) {
return <p>Greater than {age}</p>;
} else {
return <p>{age}</p>;
}
7. Components:
Core React Concepts
here are some essential concepts to learn:
React Advantages
#snsinstitutions #snsdesignthinkers #designthinking