Files
react/packages/react-dom
Andrew Clark f04bcb8139 [Bugfix] Reset subtreeFlags in resetWorkInProgress (#20948)
* Add failing regression test

Based on #20932

Co-Authored-By: Dan Abramov <dan.abramov@gmail.com>

* Reset `subtreeFlags` in `resetWorkInProgress`

Alternate fix to #20942

There was already a TODO to make this change, but at the time I left it,
I couldn't think of a way that it would actually cause a bug, and I was
hesistant to change something without fully understanding the
ramifications. This was during a time when we were hunting down a
different bug, so we were especially risk averse.

What I should have done in retrospect is put the change behind a flag
and tried rolling it out once the other bug had been flushed out.

OTOH, now we have a regression test, which wouldn't have otherwise, and
the bug it caused rarely fired in production.

Co-authored-by: Dan Abramov <dan.abramov@gmail.com>
2021-03-07 09:20:01 -08:00
..
2018-09-06 15:22:10 +01: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