Skip to content

Commit

Permalink
[Fix] actually invoke the callback
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Jan 6, 2018
1 parent c262c69 commit ffa8e87
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,12 @@ class ReactFifteenFourAdapter extends EnzymeAdapter {

invokeSetStateCallback(instance, callback) {
// React in >= 15.4, and < 16 pass undefined to a setState callback
ifReact(
const invoke = ifReact(
'^15.4',
() => { callback.call(instance, undefined); },
() => { super.invokeSetStateCallback(instance, callback); },
);
invoke();
}
}

Expand Down

0 comments on commit ffa8e87

Please sign in to comment.