From b48e551900bd7239568f3d65820ab069a5c26bda Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 12 Apr 2017 01:23:44 +0200 Subject: [PATCH] Change condition in `performBatchedUpdates` to a version check --- src/ShallowWrapper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ShallowWrapper.js b/src/ShallowWrapper.js index 2d4af03c6..9d7b74ba9 100644 --- a/src/ShallowWrapper.js +++ b/src/ShallowWrapper.js @@ -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 @@ -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); }