We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 958286e commit 3724693Copy full SHA for 3724693
packages/runtime-core/src/components/BaseTransition.ts
@@ -470,15 +470,17 @@ function getKeepAliveChild(vnode: VNode): VNode | undefined {
470
471
const { shapeFlag, children } = vnode
472
473
- if (shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
474
- return (children as VNodeArrayChildren)[0] as VNode
475
- }
+ if (children) {
+ if (shapeFlag & ShapeFlags.ARRAY_CHILDREN) {
+ return (children as VNodeArrayChildren)[0] as VNode
476
+ }
477
- if (
478
- shapeFlag & ShapeFlags.SLOTS_CHILDREN &&
479
- isFunction((children as any).default)
480
- ) {
481
- return (children as any).default()
+ if (
+ shapeFlag & ShapeFlags.SLOTS_CHILDREN &&
+ isFunction((children as any).default)
+ ) {
482
+ return (children as any).default()
483
484
}
485
486
0 commit comments