react/packages/react
Jan Kassens 346c7d4c43
straightford explicit types (#25253)
2022-09-13 17:57:38 -04:00
..
npm Remove public export for unstable-shared-subset.js (#23261) 2022-02-22 20:03:51 -05:00
src straightford explicit types (#25253) 2022-09-13 17:57:38 -04:00
README.md Bug fix for <App /> vs. <Counter /> (#24972) 2022-07-22 11:24:49 -04:00
index.classic.fb.js experimental_use(promise) (#25084) 2022-08-25 14:12:07 -04:00
index.experimental.js experimental_use(promise) (#25084) 2022-08-25 14:12:07 -04:00
index.js experimental_use(promise) (#25084) 2022-08-25 14:12:07 -04:00
index.modern.fb.js experimental_use(promise) (#25084) 2022-08-25 14:12:07 -04:00
index.stable.js [ServerContext] Flight support for ServerContext (#23244) 2022-03-08 07:55:32 -05:00
jsx-dev-runtime.js add jsx-runtime and jsx-dev-runtime (#18299) 2020-03-17 13:22:19 -07:00
jsx-runtime.js add jsx-runtime and jsx-dev-runtime (#18299) 2020-03-17 13:22:19 -07:00
package.json bump versions for next release (#24725) 2022-06-14 13:24:00 -07:00

README.md

react

React is a JavaScript library for creating user interfaces.

The react package contains only the functionality necessary to define React components. It is typically used together with a React renderer like react-dom for the web, or react-native for the native environments.

Note: by default, React will be in development mode. The development version includes extra warnings about common mistakes, whereas the production version includes extra performance optimizations and strips all error messages. Don't forget to use the production build when deploying your application.

Usage

import { useState } from 'react';
import { createRoot } from 'react-dom/client';

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

const root = createRoot(document.getElementById('root'));
root.render(<Counter />);

Documentation

See https://reactjs.org/

API

See https://reactjs.org/docs/react-api.html