Frontend JavaScript Library
React is a JavaScript library for building user interfaces, particularly single-page applications. It was developed and is maintained by Facebook (now Meta) and a community of individual developers and companies. React allows developers to create reusable UI components and efficiently update and render the right components when data changes.
React was first released in 2013 and has since become one of the most popular frontend libraries due to its declarative approach, component-based architecture, and robust ecosystem.
import React from 'react'; // Functional Component with JSX function Greeting(props) { return ( <div> <h1>Hello, {props.name}!</h1> <p>Welcome to React.</p> </div> ); } // Using the component function App() { return <Greeting name="Jane" />; }
import React, { useState, useEffect } from 'react'; function Counter() { // State hook const [count, setCount] = useState(0); // Effect hook useEffect(() => { // This runs after every render document.title = `You clicked ${count} times`; // Optional cleanup function return () => { document.title = 'React App'; }; }, [count]); // Only re-run when count changes return ( <div> <p>You clicked {count} times</p> <button onClick={() => setCount(count + 1)}> Click me </button> </div> ); }
React is primarily used for:
Major milestones in React's development:
React continues to evolve with a focus on performance improvements and developer experience.
Here are some excellent resources for learning React:
Technologies often used with React or alternative options: