# [React](https://react.dev/) · [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/facebook/react/blob/main/LICENSE) [![npm version](https://img.shields.io/npm/v/react.svg?style=flat)](https://www.npmjs.com/package/react) [![(Runtime) Build and Test](https://github.com/facebook/react/actions/workflows/runtime_build_and_test.yml/badge.svg)](https://github.com/facebook/react/actions/workflows/runtime_build_and_test.yml) [![(Compiler) TypeScript](https://github.com/facebook/react/actions/workflows/compiler_typescript.yml/badge.svg?branch=main)](https://github.com/facebook/react/actions/workflows/compiler_typescript.yml) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://legacy.reactjs.org/docs/how-to-contribute.html#your-first-pull-request) 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](https://nodejs.org/en) and power mobile apps using [React Native](https://reactnative.dev/). [Learn how to use React in your project](https://react.dev/learn). ## Installation React has been designed for gradual adoption from the start, and **you can use as little or as much React as you need**: * Use [Quick Start](https://react.dev/learn) to get a taste of React. * [Add React to an Existing Project](https://react.dev/learn/add-react-to-an-existing-project) to use as little or as much React as you need. * [Create a New React App](https://react.dev/learn/start-a-new-react-project) if you're looking for a powerful JavaScript toolchain. ## Documentation You can find the React documentation [on the website](https://react.dev/). Check out the [Getting Started](https://react.dev/learn) page for a quick overview. The documentation is divided into several sections: * [Quick Start](https://react.dev/learn) * [Tutorial](https://react.dev/learn/tutorial-tic-tac-toe) * [Thinking in React](https://react.dev/learn/thinking-in-react) * [Installation](https://react.dev/learn/installation) * [Describing the UI](https://react.dev/learn/describing-the-ui) * [Adding Interactivity](https://react.dev/learn/adding-interactivity) * [Managing State](https://react.dev/learn/managing-state) * [Advanced Guides](https://react.dev/learn/escape-hatches) * [API Reference](https://react.dev/reference/react) * [Where to Get Support](https://react.dev/community) * [Contributing Guide](https://legacy.reactjs.org/docs/how-to-contribute.html) You can improve it by sending pull requests to [this repository](https://github.com/reactjs/react.dev). ## Examples We have several examples [on the website](https://react.dev/). Here is the first one to get you started: ```jsx import { createRoot } from 'react-dom/client'; function HelloMessage({ name }) { return