react/packages/react-dom
2020-04-01 21:52:43 +01:00
..
npm make testing builds for React/ReactDOM (#17915) 2020-02-03 23:31:31 +00:00
src Revert "Fix email cursor jump (#18379)" 2020-04-01 21:52:43 +01:00
index.classic.fb.js Remove User Timings (#18417) 2020-03-31 00:29:53 +01:00
index.experimental.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08:00
index.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08:00
index.modern.fb.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08:00
index.stable.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08:00
package.json Revert accidental changes to package.json (#18348) 2020-03-19 13:16:37 -07:00
README.md Tweak react-dom README 2018-09-06 15:22:10 +01: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 Refactor Host Config Infra (getting rid of .inline*.js) (#18240) 2020-03-06 16:20:42 -08:00
testing.experimental.js Refactor Host Config Infra (getting rid of .inline*.js) (#18240) 2020-03-06 16:20:42 -08:00
testing.js Refactor Host Config Infra (getting rid of .inline*.js) (#18240) 2020-03-06 16:20:42 -08:00
testing.modern.fb.js Refactor Host Config Infra (getting rid of .inline*.js) (#18240) 2020-03-06 16:20:42 -08: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
unstable-native-dependencies.js Convert the rest of react-dom and react-test-renderer to Named Exports (#18145) 2020-02-26 18:04:32 -08: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

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