react/packages/react-dom
Brian Vaughn bcca5a6ca7
Always skip unmounted/unmounting error boundaries (#19627)
The behavior of error boundaries for passive effects that throw during cleanup was recently changed so that React ignores boundaries which are also unmounting in favor of still-mounted boundaries. This commit implements that same behavior for layout effects (useLayoutEffect, componentWillUnmount, and ref-detachment).

The new, skip-unmounting-boundaries behavior is behind a feature flag (`skipUnmountedBoundaries`).
2020-08-17 15:01:06 -04:00
..
npm ReactDOM: remove unstable-native-dependencies bundle (#18483) 2020-04-18 15:40:13 -07:00
src Always skip unmounted/unmounting error boundaries (#19627) 2020-08-17 15:01:06 -04:00
README.md Tweak react-dom README 2018-09-06 15:22:10 +01:00
index.classic.fb.js Decouple update priority tracking from Scheduler package (#19121) 2020-07-06 18:53:42 -04:00
index.experimental.js Decouple update priority tracking from Scheduler package (#19121) 2020-07-06 18:53:42 -04:00
index.js Decouple update priority tracking from Scheduler package (#19121) 2020-07-06 18:53:42 -04:00
index.modern.fb.js Decouple update priority tracking from Scheduler package (#19121) 2020-07-06 18:53:42 -04:00
index.stable.js Rename 17 to 18 in warnings (#19031) 2020-05-28 10:25:39 -07:00
package.json Fix Suspense-wrapping heuristic (and bump version numbers) (#19373) 2020-07-15 12:25:27 -04:00
server.browser.js Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) 2020-02-26 18:04:32 -08:00
server.js Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) 2020-02-26 18:04:32 -08:00
server.node.js Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) 2020-02-26 18:04:32 -08:00
test-utils.js Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) 2020-02-26 18:04:32 -08:00
testing.classic.fb.js Experimental test selector API (#18607) 2020-05-05 10:37:46 -07:00
testing.experimental.js Refactor Host Config Infra (getting rid of .inline*.js) (#18240) 2020-03-06 16:20:42 -08:00
testing.js Experimental test selector API (#18607) 2020-05-05 10:37:46 -07:00
testing.modern.fb.js Experimental test selector API (#18607) 2020-05-05 10:37:46 -07:00
testing.stable.js Refactor Host Config Infra (getting rid of .inline*.js) (#18240) 2020-03-06 16:20:42 -08:00
unstable-fizz.browser.js Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) 2020-02-26 18:04:32 -08:00
unstable-fizz.js Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) 2020-02-26 18:04:32 -08:00
unstable-fizz.node.js Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) 2020-02-26 18:04:32 -08: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

var React = require('react');
var ReactDOM = require('react-dom');

class MyComponent extends React.Component {
  render() {
    return <div>Hello World</div>;
  }
}

ReactDOM.render(<MyComponent />, node);

On the server

var React = require('react');
var ReactDOMServer = require('react-dom/server');

class MyComponent extends React.Component {
  render() {
    return <div>Hello World</div>;
  }
}

ReactDOMServer.renderToString(<MyComponent />);

API

react-dom

  • findDOMNode
  • render
  • unmountComponentAtNode

react-dom/server

  • renderToString
  • renderToStaticMarkup