Skip to content

Commit 69933e2

Browse files
authored
Expose batchedUpdates on shallow renderer (#9382)
1 parent b563af4 commit 69933e2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/renderers/testing/ReactShallowRenderer.js

+5
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,11 @@ class ReactShallowRenderer {
129129
ReactReconciler.unmountComponent(this._instance, false);
130130
}
131131
}
132+
unstable_batchedUpdates(callback, bookkeeping) {
133+
// This is used by Enzyme for fake-simulating events in shallow mode.
134+
injectDefaults();
135+
return ReactUpdates.batchedUpdates(callback, bookkeeping);
136+
}
132137
_render(element, transaction, context) {
133138
if (this._instance) {
134139
ReactReconciler.receiveComponent(

0 commit comments

Comments
 (0)