react/packages/react-dom
Dennis Moradkhani 4b877b6c66
Updated copyright text to Copyright (c) Meta Platforms, Inc. and its … (#26830)
…affiliates.

## Summary

There were 8 different places where the copyright comment was wrong.
Rewrote from "Copyright (c) Facebook, Inc. and its affiliates." to
"Copyright (c) Meta Platforms, Inc. and its affiliates."

## How did you test this change?
No code was changed. Comment was still a comment after changes.

Co-authored-by: Dennis Moradkhani <denmo530@student.liu.se>
2023-05-19 17:52:17 -07:00
..
npm Add Edge Server Builds for workerd / edge-light (#26116) 2023-02-07 15:10:01 -05:00
src Updated copyright text to Copyright (c) Meta Platforms, Inc. and its … (#26830) 2023-05-19 17:52:17 -07:00
README.md chore: update new docs links for react-dom (#26456) 2023-03-22 12:55:06 +01:00
client.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
index.classic.fb.js Add stub for experimental_useFormStatus (#26719) 2023-04-24 20:18:34 -04:00
index.experimental.js Add stub for experimental_useFormStatus (#26719) 2023-04-24 20:18:34 -04:00
index.js Add stub for experimental_useFormStatus (#26719) 2023-04-24 20:18:34 -04:00
index.modern.fb.js Add stub for experimental_useFormStatus (#26719) 2023-04-24 20:18:34 -04:00
index.stable.js [Float][Fizz][Fiber] implement preconnect and prefetchDNS float methods (#26237) 2023-02-25 11:04:51 -08:00
package.json Add missing `"react-dom/server.bun"` entry in package.json `"exports"` (#26402) 2023-03-15 22:09:49 -04:00
server-rendering-stub.js Add useFormStatus to server rendering stub (#26788) 2023-05-06 20:39:08 -04:00
server.browser.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
server.bun.js Add Bun streaming server renderer (#25597) 2022-11-17 13:15:56 -08:00
server.edge.js Add Edge Server Builds for workerd / edge-light (#26116) 2023-02-07 15:10:01 -05:00
server.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
server.node.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
static.browser.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
static.edge.js Add Edge Server Builds for workerd / edge-light (#26116) 2023-02-07 15:10:01 -05:00
static.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
static.node.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
test-utils.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00
unstable_server-external-runtime.js [ServerRenderer] Move fizz external runtime implementation to react-dom-bindings (#25617) 2022-11-03 11:15:29 -04:00
unstable_testing.classic.fb.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
unstable_testing.experimental.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
unstable_testing.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
unstable_testing.modern.fb.js Remove Reconciler fork (2/2) (#25775) 2022-12-01 23:19:13 -05:00
unstable_testing.stable.js [Codemod] Update copyright header to Meta (#25315) 2022-10-18 11:19:24 -04:00

README.md

react-dom

This package serves as the entry point to the DOM and server renderers for React. It is intended to be paired with the generic React package, which is shipped as react to npm.

Installation

npm install react react-dom

Usage

In the browser

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

function App() {
  return <div>Hello World</div>;
}

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

On the server

import { renderToPipeableStream } from 'react-dom/server';

function App() {
  return <div>Hello World</div>;
}

function handleRequest(res) {
  // ... in your server handler ...
  const stream = renderToPipeableStream(<App />, {
    onShellReady() {
      res.statusCode = 200;
      res.setHeader('Content-type', 'text/html');
      stream.pipe(res);
    },
    // ...
  });
}

API

react-dom

See https://react.dev/reference/react-dom

react-dom/client

See https://react.dev/reference/react-dom/client

react-dom/server

See https://react.dev/reference/react-dom/server