The React package contains all the APIs necessary to define and use components.

Installation

It is available as react on npm. You can also add React to the page as a <script> tag.

Terminal
npm install react
// Importing a specific API:
import { useState } from 'react';

// Importing all APIs together:
import * as React from 'react';

If you use React on the web, you’ll also need the same version of ReactDOM.

Exports

useState

A React Hook that lets a component “remember” some information (called state).

This section is incomplete and is still being written!