Skip to content

Commit fb769c1

Browse files
committed
use lifecycles adapter option
1 parent 16fc901 commit fb769c1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

packages/enzyme/src/ShallowWrapper.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -348,13 +348,13 @@ class ShallowWrapper {
348348
snapshot = instance.getSnapshotBeforeUpdate(prevProps, state);
349349
}
350350
// componentDidUpdate
351-
if (typeof instance.componentDidUpdate === 'function') {
351+
if (
352+
lifecycles.componentDidUpdate &&
353+
typeof instance.componentDidUpdate === 'function'
354+
) {
352355
if (lifecycles.getSnapshotBeforeUpdate) {
353356
instance.componentDidUpdate(prevProps, state, snapshot);
354-
} else if (
355-
lifecycles.componentDidUpdate &&
356-
lifecycles.componentDidUpdate.prevContext
357-
) {
357+
} else if (lifecycles.componentDidUpdate.prevContext) {
358358
instance.componentDidUpdate(prevProps, state, prevContext);
359359
} else {
360360
instance.componentDidUpdate(prevProps, state);

0 commit comments

Comments
 (0)