react-dom
    Overview
    Insights & Analysis
    Code
    Versions
    Find an Expert
    Documentation
    Playground
    Issues
    Career Opportunities
    Alternatives
    Dependencies

react-dom

React package for working with the DOM.

16.9.0  •  Published 15 days ago  •  by facebook  •  MIT License

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

Dependencies

Tags

react
Avoid unsafe or low quality packages
Warn or block the installation of vulnerable, badly licensed, deprecated, outdated, unmaintained, or unpopular packages. Integrates with your npm and pre-commit/build scripts
Just $9/month per developer

Popularity

Weekly Downloads
4.8M
Stars
133.5K

Issues and PRs

Activity

Last ver 15 days ago
Created 5 years ago
Last commit 1 month ago
8 hours between commits

Sustainability

145 contributors

Technology

Node version: 10.14.2
3102.5K unpacked

Legal and Compliance

MIT License
OSI Approved
0 vulnerabilities

Top Experts

zpao
294 merges, 56 PRs
Dan Abramov
Maintainer, 210 commits, 2 PRs
Works at facebook
Andrew Clark
Maintainer, 167 commits
Works at facebook
Dominic Gannaway
140 commits
Works at facebook
petehunt
127 merges, 54 PRs
Brian Vaughn
Maintainer, 121 commits
Works at facebook