Skip to content

Commit

Permalink
Use public API for batchedUpdates
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 committed May 11, 2016
1 parent 77400ee commit 1c866e1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/react-compat.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ let findDOMNode;
let childrenToArray;
let renderWithOptions;
let unmountComponentAtNode;
let batchedUpdates;

const React = require('react');
const batchedUpdates = require('react/lib/ReactUpdates').batchedUpdates;

if (REACT013) {
renderToStaticMarkup = React.renderToStaticMarkup;
Expand All @@ -21,6 +21,7 @@ if (REACT013) {
unmountComponentAtNode = React.unmountComponentAtNode;
/* eslint-enable react/no-deprecated */
TestUtils = require('react/addons').addons.TestUtils;
batchedUpdates = require('react/addons').addons.batchedUpdates;
const ReactContext = require('react/lib/ReactContext');

// Shallow rendering in 0.13 did not properly support context. This function provides a shim
Expand Down Expand Up @@ -77,6 +78,7 @@ if (REACT013) {
renderToStaticMarkup = require('react-dom/server').renderToStaticMarkup;
findDOMNode = ReactDOM.findDOMNode;
unmountComponentAtNode = ReactDOM.unmountComponentAtNode;
batchedUpdates = ReactDOM.unstable_batchedUpdates;
// We require the testutils, but they don't come with 0.14 out of the box, so we
// require them here through this node module. The bummer is that we are not able
// to list this as a dependency in package.json and have 0.13 work properly.
Expand Down

0 comments on commit 1c866e1

Please sign in to comment.