Framework25M+/wkMIT

react

React is the most popular JavaScript library for building user interfaces, developed and maintained by Meta (formerly Facebook). React introduced the component-

Installation

npm
npm install react
yarn
yarn add react
pnpm
pnpm add react

Import

ESM
import { useState } from 'react';

Quick Example

usage
function Counter() {
  const [count, setCount] = useState(0);
  return (
    <button onClick={() => setCount(count + 1)}>
      Count: {count}
    </button>
  );
}

About react

React is the most popular JavaScript library for building user interfaces, developed and maintained by Meta (formerly Facebook). React introduced the component-based architecture and virtual DOM concepts that have become standard across modern frontend development. Components in React are JavaScript functions that return JSX, a syntax extension that looks like HTML but compiles to JavaScript function calls. React's declarative approach means developers describe what the UI should look like for a given state, and React efficiently updates the DOM to match. The library introduced hooks in version 16.8, providing useState, useEffect, useContext, useReducer, and other primitives for managing state and side effects in function components. React 18 brought concurrent features including automatic batching, transitions, Suspense for data fetching, and streaming server-side rendering. React Server Components, introduced with React 19, allow components to run exclusively on the server, reducing client-side JavaScript. React's ecosystem is the largest in frontend development, with thousands of libraries, tools, and learning resources available.

Quick Facts

Packagereact
CategoryFramework
Weekly Downloads25M+
LicenseMIT
Installnpm install react

Related Packages

Browse npm Packages by Category

Explore our reference of 200 popular npm packages with install commands, examples, and quick-start guides.