react-dom
React package for working with the DOM.
Last updated 3 years ago by acdlite .
MIT · Repository · Bugs · Original npm
$ cnpm install react-dom 
SYNC missed versions from official npm registry.

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://reactjs.org/docs/react-dom.html

react-dom/client

See https://reactjs.org/docs/react-dom-client.html

react-dom/server

See https://reactjs.org/docs/react-dom-server.html

Current Tags

  • 18.2.0                                ...           latest (3 years ago)
  • 18.3.0-next-5379b6123-20230105                                ...           next (3 years ago)
  • 16.3.3                                ...           tmp (7 years ago)

40 Versions

  • 18.3.0-next-5379b6123-20230105                                ...           3 years ago
  • 18.3.0-next-4ea063b56-20221101                                ...           3 years ago
  • 18.3.0-next-2ac77aab9-20221029                                ...           3 years ago
  • 18.3.0-next-522f47345-20220614                                ...           3 years ago
  • 18.2.0                                ...           3 years ago
  • 18.0.0-rc.3                                ...           3 years ago
  • 18.2.0-next-2c68776ab-20220525                                ...           3 years ago
  • 18.1.0                                ...           3 years ago
  • 18.0.0-rc.0                                ...           4 years ago
  • 18.0.0-beta-24dd07bd2-20211208                                ...           4 years ago
  • 0.0.0-9d48779b3                                ...           4 years ago
  • 0.0.0-experimental-9d48779b3                                ...           4 years ago
  • 17.0.2                                ...           4 years ago
  • 0.0.0-4190a3458                                ...           5 years ago
  • 17.0.1                                ...           5 years ago
  • 0.0.0-experimental-4190a3458                                ...           5 years ago
  • 15.7.0                                ...           5 years ago
  • 16.14.0                                ...           5 years ago
  • 17.0.0-rc.3                                ...           5 years ago
  • 0.0.0-experimental-4ead6b530                                ...           5 years ago
  • 15.3.2                                ...           9 years ago
  • 17.0.0-rc.2                                ...           5 years ago
  • 17.0.0-rc.1                                ...           5 years ago
  • 0.0.0-experimental-94c0244ba                                ...           5 years ago
  • 15.4.2                                ...           9 years ago
  • 16.0.0 [deprecated]           ...           8 years ago
  • 15.0.0                                ...           9 years ago
  • 0.14.9                                ...           8 years ago
  • 15.2.1                                ...           9 years ago
  • 16.5.2                                ...           7 years ago
  • 16.3.3                                ...           7 years ago
  • 15.6.1                                ...           8 years ago
  • 0.14.7                                ...           10 years ago
  • 16.3.2 [deprecated]           ...           7 years ago
  • 16.12.0                                ...           6 years ago
  • 16.8.0                                ...           7 years ago
  • 16.2.0 [deprecated]           ...           8 years ago
  • 15.6.2                                ...           8 years ago
  • 16.8.6                                ...           6 years ago
  • 16.13.1                                ...           5 years ago
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2013 - present © cnpmjs.org