React is a popular JavaScript library used for building user interfaces, especially web applications. It helps developers build apps by breaking the UI into components—small, reusable pieces of code (like buttons, forms, or entire sections of a page).
Key Ideas:
- Component-based - build UI in pieces and reuse them.
- Virtual DOM - React updates only the parts of the page that change, making apps faster.
- Declarative - you describe what the UI should look like, and React handles how to update it.
Example:
function Hello() {
return <h1>Hello, world!</h1>;
}
This simple React component shows “Hello, world!” on a webpage.