Skip to content

Commit

Permalink
Change condition in performBatchedUpdates to a version check
Browse files Browse the repository at this point in the history
  • Loading branch information
nfcampos authored and ljharb committed Apr 12, 2017
1 parent 2f957af commit b48e551
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/ShallowWrapper.js
Expand Up @@ -37,6 +37,7 @@ import {
batchedUpdates,
isDOMComponentElement,
} from './react-compat';
import { REACT155 } from './version';

/**
* Finds all nodes in the current wrapper nodes' render trees that match the provided predicate
Expand Down Expand Up @@ -101,7 +102,7 @@ function validateOptions(options) {

function performBatchedUpdates(wrapper, fn) {
const renderer = wrapper.root.renderer;
if (renderer.unstable_batchedUpdates) {
if (REACT155) {
// React 15.5+ exposes batching on shallow renderer itself
return renderer.unstable_batchedUpdates(fn);
}
Expand Down

0 comments on commit b48e551

Please sign in to comment.