# React — card for AI agents

JavaScript library for building interactive user interfaces with components.

Category: Web frameworks · npm package `react` · latest version 19.3.1 (checked 2026-11-01)
Install: `npm install react`
License: MIT (permissive)

In your own product (generator, app, hosted service): **yes**. Permissive license: ship it inside your own product, closed or open source, and keep its license and copyright notice.

## Rules for AI agents (paste into AGENTS.md or CLAUDE.md)

## React
- Start component names with a capital letter. HTML tags stay lowercase.
- Close every JSX tag (``). Wrap multiple returned tags in one parent or an empty `<>...` wrapper.
- Give each list item a `key` that is a string or number from the data, such as a database ID, unique among its siblings.
- Pass event handlers without calling them: `onClick={handleClick}`, with no parentheses at the end.
- Call Hooks such as `useState` only at the top of components or other Hooks.
- With React Compiler, rely on the compiler for memoization in new code. In existing code, leave `useMemo`/`useCallback` in place or test carefully before removing them.
- React does not do routing or data fetching. For a full app, use a framework such as Next.js or React Router.

## Agent Skills for it
- react-modernization from wshobson/agents: `npx skills add wshobson/agents --skill react-modernization`
- react-native-dev from MiniMax-AI/skills: `npx skills add MiniMax-AI/skills --skill react-native-dev`
- react-expert from Jeffallan/claude-skills: `npx skills add Jeffallan/claude-skills --skill react-expert`
- react-vite-dashboard from google-labs-code/stitch-skills: `npx skills add google-labs-code/stitch-skills --skill react-vite-dashboard`
- react-composition-patterns from tech-leads-club/agent-skills: `npx skills add tech-leads-club/agent-skills --skill react-composition-patterns`
- react-hook-form from midudev/autoskills: `npx skills add midudev/autoskills --skill react-hook-form`

## Docs written for agents
- [llms.txt (index of the docs)](https://react.dev/llms.txt)

## What it is
- React is a JavaScript library for building user interfaces. You build the UI out of components, which are JavaScript functions that return markup written in JSX. The README says you design simple views for each state, and React updates and renders the right components when your data changes.
- React draws a clear line around its job. It composes components, and the site says it "doesn’t prescribe how to do routing and data fetching". For a whole app it recommends a full-stack framework. You can also drop React into one part of an existing HTML page. The same component model renders on the server through Node and powers Android and iOS apps through React Native.
- It fits projects that want React for components and will leave routing and data fetching to a framework or to their own choices. A separate build-time tool, React Compiler, adds memoization automatically. The docs call the compiler stable and an optional addition today.

## Caveats
- You still need a framework for a full app: React does not handle routing or data fetching. The site recommends Next.js or React Router to build an entire app.
- No built-in styling approach: You add classes with `className`, but React does not say how CSS files get into the project. The docs point you to your build tool or framework's documentation.
- Hooks have placement rules: Functions whose names start with `use` are Hooks. The Quick Start says they are more restrictive than other functions: you can only call them at the top of your components or other Hooks.
- Compiler memoization has limits: The compiler only memoizes components and Hooks, and it does not share cached results across them. The docs say an expensive helper used in many components will run again in each one.
- Compiler rollout depends on your code: The docs call the compiler stable. They also say whether it is safe to roll out depends on how closely your codebase follows the Rules of React.

## Numbers (AgentGid data)
- Gid Score: 94.0 (#1 of all tools, 1 of 75 in its category)
- Used in 2,037 public projects set up for AI coding agents (32.6%)
- Downloads last week: 260,880,973 (as of 2026-11-17), +19.5% over 4 weeks
- GitHub stars: 252,726 (as of 2026-11-17)
- Last push: 2026-11-17

## Often used with
Tailwind CSS 79.6%, Lucide React 60.9%, Next.js 54.2%, clsx 55.8%, TypeScript 92.7%, Tailwind Merge 53.8%

## Checked alternatives (same job)
- Vue: https://agentgid.com/tools/vue/agent.md
- Angular: https://agentgid.com/tools/angular/agent.md
- Svelte: https://agentgid.com/tools/svelte/agent.md
- Nuxt: https://agentgid.com/tools/nuxt/agent.md

## Links
- AgentGid page: https://agentgid.com/tools/react/
- Homepage: https://react.dev/
- Repository: https://github.com/react/react
- Source: https://github.com/react/react#readme
- Source: https://github.com/react/react
- Source: https://github.com/react/react/releases
- Source: https://react.dev
- Source: https://react.dev/learn.md
- Source: https://react.dev/learn/tutorial-tic-tac-toe.md
- Source: https://react.dev/learn/react-compiler/introduction.md


## React: build the interactive parts of web apps

React is a free JavaScript library for building the parts of a web page people click and type into, from one button to a whole app. You describe each piece once, such as a plan card or a search box, and React updates the screen when the data changes. Routing, data loading and hosting come from a framework built on it, such as Next.js.

### Where to use it
- Buttons and forms that react to clicks: A counter, a like button or a form that shows errors while someone types; the screen changes as soon as the data does.
- A pricing page with a yearly switch: Visitors flip between monthly and yearly prices and pick a plan; the cards and the summary line update at once. (idea, not from the official pages)
- Add a widget to an existing site: Your site is built with Rails, Django or plain HTML; React runs only inside one box on the page, such as a calculator or a booking form.
- A whole web app or site: For a new app with many pages, sign-in and data, start from a React framework that adds page routing and loading.
- Reuse the same piece everywhere: A product card, a price tag or a sign-up box is written once and used on every page, so a change shows up everywhere.
- Phone apps from the same skills: The same component style also builds iPhone and Android apps through React Native, so a web team can make a mobile app.

### How to start
- For a new app, start from a framework that the React docs list, such as Next.js or React Router, with a pinned version.
- To add React to an existing project, install both packages.

```
npm install react react-dom
```

- Then render your first component into a box on the page with createRoot.

```
import { createRoot } from 'react-dom/client';
const domNode = document.getElementById('root');
const root = createRoot(domNode);
```


### License
Free for any use, also in paid and closed-source products, under the MIT license. No visible credit is needed; keep the license notice if you ship React's own files.

### Good to know
- React draws the screen but does not decide pages, links or data loading. For a full app the docs recommend a framework.
- You need Node.js on your computer to develop with it, even though the finished site can be plain files.
- Create React App, the old starter kit, is retired. Do not start new projects with it.
- In December 2025 a critical hole was found in React Server Components; it affects only apps that run React on a server, which must use patched versions.
- Since February 2026, React belongs to the React Foundation under the Linux Foundation, no longer to Meta.

Checked 2026-11-10 against: https://react.dev/, https://react.dev/learn/installation, https://react.dev/learn/creating-a-react-app, https://react.dev/learn/add-react-to-an-existing-project, https://react.dev/reference/react-dom/client/createRoot, https://react.dev/reference/react/useState, https://react.dev/versions, https://react.dev/blog/2024/04/25/react-19-upgrade-guide, https://react.dev/blog/2025/12/03/critical-security-vulnerability-in-react-server-components, https://react.dev/blog/2026/02/24/the-react-foundation, https://react.dev/blog/2026/09/09/react-19-3, https://github.com/react/react/blob/main/README.md, https://github.com/react/react/blob/main/LICENSE, https://github.com/react/react/releases/tag/v19.3.1, https://registry.npmjs.org/react-dom/19.3.1

### Mistakes to avoid
- Don't: import { render } from 'react-dom'; render(<App />, el) → Do: import { createRoot } from 'react-dom/client'; createRoot(el).render(<App />) (ReactDOM.render was removed in React 19.)
- Don't: <script src="https://unpkg.com/react@19/umd/react.production.min.js"> → Do: Use a build tool such as Vite, or load React as a module from an ESM-based CDN (React 19 no longer publishes UMD (script-tag) builds.)
- Don't: npx create-react-app my-app → Do: Start with a framework from the docs (Next.js, React Router) or Vite (Create React App is deprecated.)
- Don't: Relying on propTypes on function components to catch bad props → Do: Use TypeScript or another type checker (React 19 silently ignores propTypes.)
- Don't: Keeping a Server Components app on react-server-dom-* 19.0, 19.1.0, 19.1.1 or 19.2.0 → Do: Update React and the framework (Next.js, React Router and others) to their patched releases (Those versions have a critical remote code execution hole (CVE-2025-55182).)

### Questions
- Can I just add a script tag, without a build step? React 19 no longer ships the old script-tag files. The docs suggest loading it as a module from an ESM-based CDN; for real projects they use a build tool.
- Do I need a server to use a React framework? No. The frameworks the docs list can also make a static site or a single-page app that you host as plain files.
- Can I use React on only part of a page? Yes. You can render React components into one or several boxes on an existing page.
- What is the current version? The docs show 19.3 as the latest version; 19.3.1 is the current release on the package registry.

---
AgentGid's catalog is curated: every entry was checked against the maker's official pages (registry, repository, license and pricing pages) on the date shown; a license value shows the quote it stands on wherever AgentGid has one. Usage numbers come from AgentGid's own scan of public repositories set up for AI coding agents. Claims by makers are reported, not tested by AgentGid.
