From 69933e25c37cf5453a9ef132177241203ee8d2fd Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Sat, 8 Apr 2017 22:46:04 +0100 Subject: [PATCH] Expose batchedUpdates on shallow renderer (#9382) --- src/renderers/testing/ReactShallowRenderer.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/renderers/testing/ReactShallowRenderer.js b/src/renderers/testing/ReactShallowRenderer.js index b6b565f82c756..9e1e16e86e714 100644 --- a/src/renderers/testing/ReactShallowRenderer.js +++ b/src/renderers/testing/ReactShallowRenderer.js @@ -129,6 +129,11 @@ class ReactShallowRenderer { ReactReconciler.unmountComponent(this._instance, false); } } + unstable_batchedUpdates(callback, bookkeeping) { + // This is used by Enzyme for fake-simulating events in shallow mode. + injectDefaults(); + return ReactUpdates.batchedUpdates(callback, bookkeeping); + } _render(element, transaction, context) { if (this._instance) { ReactReconciler.receiveComponent(