react/packages/react-dom
Steve Harrison f3ecd56bea
Fixed a spelling mistake in a comment. (#18119)
2020-02-25 21:01:08 -08:00
..
npm make testing builds for React/ReactDOM (#17915) 2020-02-03 23:31:31 +00:00
src Fixed a spelling mistake in a comment. (#18119) 2020-02-25 21:01:08 -08:00
README.md Tweak react-dom README 2018-09-06 15:22:10 +01:00
index.classic.fb.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08: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 [Flight] Move Flight DOM to a Webpack Specific Package (#17372) 2019-11-15 11:46:07 -08:00
server.browser.js Drop the year from Facebook copyright headers and the LICENSE file. (#13593) 2018-09-07 15:11:23 -07:00
server.js Drop the year from Facebook copyright headers and the LICENSE file. (#13593) 2018-09-07 15:11:23 -07:00
server.node.js Drop the year from Facebook copyright headers and the LICENSE file. (#13593) 2018-09-07 15:11:23 -07:00
test-utils.js Drop the year from Facebook copyright headers and the LICENSE file. (#13593) 2018-09-07 15:11:23 -07:00
testing.classic.fb.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08:00
testing.experimental.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08:00
testing.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08:00
testing.modern.fb.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08:00
testing.stable.js Export React as Named Exports instead of CommonJS (#18106) 2020-02-25 13:54:27 -08:00
unstable-fizz.browser.js [Fizz] New Server Rendering Infra (#14144) 2018-11-30 11:38:22 -08:00
unstable-fizz.js [Fizz] New Server Rendering Infra (#14144) 2018-11-30 11:38:22 -08:00
unstable-fizz.node.js [Fizz] New Server Rendering Infra (#14144) 2018-11-30 11:38:22 -08:00
unstable-native-dependencies.js Drop the year from Facebook copyright headers and the LICENSE file. (#13593) 2018-09-07 15:11:23 -07: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