react/packages/react
Sebastian Markbåge 01a0c4e12c
Add Edge Server Builds for workerd / edge-light (#26116)
We currently abuse the browser builds for Web streams derived
environments. We already have a special build for Bun but we should also
have one for [other "edge"
runtimes](https://runtime-keys.proposal.wintercg.org/) so that we can
maximally take advantage of the APIs that exist on each platform.

In practice, we currently check for a global property called
`AsyncLocalStorage` in the server browser builds which we shouldn't
really do since browsers likely won't ever have it. Additionally, this
should probably move to an import which we can't add to actual browser
builds where that will be an invalid import. So it has to be a separate
build. That's not done yet in this PR but Vercel will follow
Cloudflare's lead here.

The `deno` key still points to the browser build since there's no
AsyncLocalStorage there but it could use this same or a custom build if
support is added.
2023-02-07 15:10:01 -05:00
..
npm Remove public export for unstable-shared-subset.js (#23261) 2022-02-22 20:03:51 -05:00
src Add Edge Server Builds for workerd / edge-light (#26116) 2023-02-07 15:10:01 -05:00
README.md Bug fix for <App /> vs. <Counter /> (#24972) 2022-07-22 11:24:49 -04:00
index.classic.fb.js Rename experimental useEvent to useEffectEvent (#25881) 2022-12-14 15:08:29 -05:00
index.experimental.js Rename experimental useEvent to useEffectEvent (#25881) 2022-12-14 15:08:29 -05:00
index.js Upgrade prettier (#26081) 2023-01-31 08:25:05 -05:00
index.modern.fb.js Rename experimental useEvent to useEffectEvent (#25881) 2022-12-14 15:08:29 -05:00
index.stable.js Update cache() and use() to the canary aka next channel (#25502) 2022-10-23 23:20:52 -04:00
jsx-dev-runtime.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
jsx-runtime.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
package.json bump versions for next release (#24725) 2022-06-14 13:24:00 -07:00
react.shared-subset.js Let ReactDOM initialize in RSC (#25503) 2022-10-21 10:41:14 -04: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