We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 14d3958 commit b5281dbCopy full SHA for b5281db
packages/enzyme/src/ReactWrapper.js
@@ -841,8 +841,9 @@ class ReactWrapper {
841
throw new TypeError('ReactWrapper::invoke() requires the name of a prop whose value is a function');
842
}
843
return (...args) => {
844
- const wrapAct = this[RENDERER].act || function wrapAct(fn) { return fn(); };
845
- const response = wrapAct(() => handler(...args));
+ const response = typeof this[RENDERER].act === 'function'
+ ? this[RENDERER].act(() => handler(...args))
846
+ : handler(...args);
847
this[ROOT].update();
848
return response;
849
};
0 commit comments