mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
* Drop fbjs/lib/EventListener from tests Assert on the underlying native event listener instead. This test file still needs to be rewritten in terms of public APIs. * Inline fbjs/lib/EventListener dependency We explicitly don't want to shim this and we don't use the return value. We can probably even drop the IE path now since we don't support it. Not sure if that'll be a true breaking change though. * Wrap event listeners and the callback passed to requestIdleCallback This is a FBism. This uses the injection model in ReactErrorUtils. This isn't technically going to used for errors but close enough. This really wants to be eager but we can't because of dynamic injection.
react-dom
This package serves as the entry point of the DOM-related rendering paths. It is intended to be paired with the isomorphic React, which will be 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
findDOMNoderenderunmountComponentAtNode
react-dom/server
renderToStringrenderToStaticMarkup