mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
* Rename Scheduler methods more accurately **what is the change?:** ``` rIC -> scheduleCallback ``` We will later expose a second method for different priority level, name TBD. Since we only have one priority right now we can delay the bikeshedding about the priority names. cIC -> cancelScheduledCallback This method can be used to cancel callbacks scheduled at any priority level, and will remain named this way. why make this change?: Originally this module contained a polyfill for requestIdleCallback and cancelIdleCallback but we are changing the behavior so it's no longer just a polyfill. The new names are more semantic and distinguish this from the original polyfill functionality. **test plan:** Ran the tests **why make this change?:** Getting this out of the way so things are more clear. **Coming Up Next:** - Switching from a Map of ids and an array to a linked list for storing callbacks. - Error handling * callback -> work * update callsites in new places after rebase * fix typo
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