Skip to content

Commit

Permalink
use lifecycles adapter option
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 committed Jul 4, 2018
1 parent 16fc901 commit fb769c1
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/enzyme/src/ShallowWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,13 +348,13 @@ class ShallowWrapper {
snapshot = instance.getSnapshotBeforeUpdate(prevProps, state);
}
// componentDidUpdate
if (typeof instance.componentDidUpdate === 'function') {
if (
lifecycles.componentDidUpdate &&
typeof instance.componentDidUpdate === 'function'
) {
if (lifecycles.getSnapshotBeforeUpdate) {
instance.componentDidUpdate(prevProps, state, snapshot);
} else if (
lifecycles.componentDidUpdate &&
lifecycles.componentDidUpdate.prevContext
) {
} else if (lifecycles.componentDidUpdate.prevContext) {
instance.componentDidUpdate(prevProps, state, prevContext);
} else {
instance.componentDidUpdate(prevProps, state);
Expand Down

0 comments on commit fb769c1

Please sign in to comment.