This repository has been archived on 2026-07-15. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
drive/frontend/node_modules/react-dom
Elijah 724d70e58b
Some checks failed
Automated Container Build / build-and-push (push) Failing after 12s
Inital build
2026-05-22 12:29:43 -07:00
..
cjs Inital build 2026-05-22 12:29:43 -07:00
client.js Inital build 2026-05-22 12:29:43 -07:00
client.react-server.js Inital build 2026-05-22 12:29:43 -07:00
index.js Inital build 2026-05-22 12:29:43 -07:00
LICENSE Inital build 2026-05-22 12:29:43 -07:00
package.json Inital build 2026-05-22 12:29:43 -07:00
profiling.js Inital build 2026-05-22 12:29:43 -07:00
profiling.react-server.js Inital build 2026-05-22 12:29:43 -07:00
react-dom.react-server.js Inital build 2026-05-22 12:29:43 -07:00
README.md Inital build 2026-05-22 12:29:43 -07:00
server.browser.js Inital build 2026-05-22 12:29:43 -07:00
server.bun.js Inital build 2026-05-22 12:29:43 -07:00
server.edge.js Inital build 2026-05-22 12:29:43 -07:00
server.js Inital build 2026-05-22 12:29:43 -07:00
server.node.js Inital build 2026-05-22 12:29:43 -07:00
server.react-server.js Inital build 2026-05-22 12:29:43 -07:00
static.browser.js Inital build 2026-05-22 12:29:43 -07:00
static.edge.js Inital build 2026-05-22 12:29:43 -07:00
static.js Inital build 2026-05-22 12:29:43 -07:00
static.node.js Inital build 2026-05-22 12:29:43 -07:00
static.react-server.js Inital build 2026-05-22 12:29:43 -07:00
test-utils.js Inital build 2026-05-22 12:29:43 -07:00

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