fix(TransitionGroup): ignore comment node when warn (fix#869) (#875)

This commit is contained in:
ysj16 2020-03-25 00:09:42 +08:00 committed by GitHub
parent 4cb3c5c49a
commit 0dba5d44e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -9,6 +9,7 @@ import {
} from './Transition'
import {
Fragment,
Comment,
VNode,
warn,
resolveTransitionHooks,
@ -108,7 +109,7 @@ const TransitionGroupImpl = {
child,
resolveTransitionHooks(child, cssTransitionProps, state, instance)
)
} else if (__DEV__) {
} else if (__DEV__ && child.type !== Comment) {
warn(`<TransitionGroup> children must be keyed.`)
}
}