feat(transition): warn non-animatable component root node

This commit is contained in:
Evan You 2019-11-25 10:04:00 -05:00
parent e83984d7fc
commit 01eb3c12e9

View File

@ -88,7 +88,16 @@ export function renderComponentRoot(
// inherit transition data // inherit transition data
if (vnode.transition != null) { if (vnode.transition != null) {
// TODO warn if component has transition data but root is a fragment if (
__DEV__ &&
!(result.shapeFlag & ShapeFlags.COMPONENT) &&
!(result.shapeFlag & ShapeFlags.ELEMENT)
) {
warn(
`Component inside <Transition> renders non-element root node ` +
`that cannot be animated.`
)
}
result.transition = vnode.transition result.transition = vnode.transition
} }
} catch (err) { } catch (err) {