React is a JavaScript library under the MIT licence for building user interfaces, using a declarative, component-based model that renders both on the web and, through React Native, on mobile.
What it is
React is a JavaScript library for building user interfaces, published on npm as react and developed in the open on GitHub by its maintainers and community of contributors. It is declarative, meaning each view is described for each state of the application and React updates and renders the right components when the data changes; it is component-based, meaning encapsulated components manage their own state and compose into more complex interfaces; and its logic lives in JavaScript rather than in templates, which keeps application state out of the DOM. The repository also covers server rendering through Node and native mobile interfaces through React Native, and it is licensed under MIT.
The specific thing it replaces is the manual, imperative wiring of user interfaces: writing code that reaches into the DOM and updates elements by hand as application data changes. React moves that responsibility into the library. Views are declared for each state, and the library handles re-rendering when data changes, which the project describes as making code more predictable, simpler to understand and easier to debug. Because component logic is written in JavaScript and rich data can be passed through the application rather than baked into markup, the same component model carries across a web application, a Node-rendered page and a React Native mobile app, under the project's "Learn Once, Write Anywhere" approach.
Key capabilities
- Declarative rendering: describe a view per application state; React updates and renders the correct components when data changes.
- Component composition: encapsulated components manage their own state and combine into complex interfaces, with logic in JavaScript instead of templates.
- JSX syntax: an HTML-like markup extension that is not required but makes component code more readable; documented at
react.dev/learn#writing-markup-with-jsx.
- Client rendering entry point: import
createRoot from react-dom/client and call root.render(...) to mount an element into a container.
- Server rendering on Node.
- Native mobile interfaces through React Native.
- Gradual adoption: add React to an existing project with as little or as much of it as needed, or start a new app with a JavaScript toolchain.
Who uses it and how
- Teams with an existing frontend who add React incrementally, following the "Add React to an Existing Project" guide rather than rewriting the whole application.
- Developers starting greenfield applications who pick a JavaScript toolchain via the "Create a New React App" path.
- Server-rendered web applications that render on Node while sharing the same component model with the browser build.
- Mobile teams building native apps with React Native while reusing React patterns and component knowledge across platforms.
- Contributors working on React core itself, since development happens in the open on GitHub and bugfixes and improvements are accepted as pull requests, with a contributing guide for first-time contributors.
Getting started
Install the library from npm as the react package and follow the Quick Start at react.dev/learn; the minimal example imports createRoot from react-dom/client, renders a component tree into a container element, and is available in the documentation alongside the full API reference and tutorial.
How it compares
No paid products or competing frameworks are named in the provided facts, so React stands alone in this registry. The only adjacent projects the README references are Node, for server rendering, and React Native, for mobile — both companions to React rather than substitutes for it.
When to use it — and when not to
Choose React when a declarative, component-based UI is wanted and the surrounding stack is free to be chosen, since the project deliberately makes no assumptions about the rest of the technology stack. Do not choose it if the goal is a batteries-included framework that dictates routing, data handling and build tooling, because adopting React means selecting and operating that toolchain yourself. Its own weak spots are evident in the material: the installation section links out to react.dev instead of giving one command, and parts of the contributing guidance still live on legacy.reactjs.org.
project readme (upstream, from github) — read inline
React is a JavaScript library for building user interfaces.
- Declarative: React makes it painless to create interactive UIs. Design simple views for each state in your application, and React will efficiently update and render just the right components when your data changes. Declarative views make your code more predictable, simpler to understand, and easier to debug.
- Component-Based: Build encapsulated components that manage their own state, then compose them to make complex UIs. Since component logic is written in JavaScript instead of templates, you can easily pass rich data through your app and keep the state out of the DOM.
- Learn Once, Write Anywhere: We don't make assumptions about the rest of your technology stack, so you can develop new features in React without rewriting existing code. React can also render on the server using Node and power mobile apps using React Native.
Learn how to use React in your project.
Installation
React has been designed for gradual adoption from the start, and you can use as little or as much React as you need:
Documentation
You can find the React documentation on the website.
Check out the Getting Started page for a quick overview.
The documentation is divided into several sections:
You can improve it by sending pull requests to this repository.
Examples
We have several examples on the website. Here is the first one to get you started:
import { createRoot } from 'react-dom/client';
function HelloMessage({ name }) {
return <div>Hello {name}</div>;
}
const root = createRoot(document.getElementById('container'));
root.render(<HelloMessage name="Taylor" />);
This example will render "Hello Taylor" into a container on the page.
You'll notice that we used an HTML-like syntax; we call it JSX. JSX is not required to use React, but it makes code more readable, and writing it feels like writing HTML.
Contributing
The main purpose of this repository is to continue evolving React core, making it faster and easier to use. Development of React happens in the open on GitHub, and we are grateful to the community for contributing bugfixes and improvements. Read below to learn how you can take part in improving React.
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please read the full text so that you can understand what actions will and will not be tolerated.
Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React.
To help you get your feet wet and get you familiar with our contribution process, we have a list of good first issues that contain bugs that have a relatively limited scope. This is a great place to get started.
License
React is MIT licensed.