( type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, props: (Data & VNodeProps) | null = null, children: unknown = null, patchFlag = 0, dynamicProps: string[] | null = null, shapeFlag: number = type === Fragment ? 0 : ShapeFlags.ELEMENT, isBlockNode = false, needFullChildrenNormalization = false, )
| 454 | } |
| 455 | |
| 456 | function createBaseVNode( |
| 457 | type: VNodeTypes | ClassComponent | typeof NULL_DYNAMIC_COMPONENT, |
| 458 | props: (Data & VNodeProps) | null = null, |
| 459 | children: unknown = null, |
| 460 | patchFlag = 0, |
| 461 | dynamicProps: string[] | null = null, |
| 462 | shapeFlag: number = type === Fragment ? 0 : ShapeFlags.ELEMENT, |
| 463 | isBlockNode = false, |
| 464 | needFullChildrenNormalization = false, |
| 465 | ): VNode { |
| 466 | const vnode = { |
| 467 | __v_isVNode: true, |
| 468 | __v_skip: true, |
| 469 | type, |
| 470 | props, |
| 471 | key: props && normalizeKey(props), |
| 472 | ref: props && normalizeRef(props), |
| 473 | scopeId: currentScopeId, |
| 474 | slotScopeIds: null, |
| 475 | children, |
| 476 | component: null, |
| 477 | suspense: null, |
| 478 | ssContent: null, |
| 479 | ssFallback: null, |
| 480 | dirs: null, |
| 481 | transition: null, |
| 482 | el: null, |
| 483 | anchor: null, |
| 484 | target: null, |
| 485 | targetStart: null, |
| 486 | targetAnchor: null, |
| 487 | staticCount: 0, |
| 488 | shapeFlag, |
| 489 | patchFlag, |
| 490 | dynamicProps, |
| 491 | dynamicChildren: null, |
| 492 | appContext: null, |
| 493 | ctx: currentRenderingInstance, |
| 494 | } as VNode |
| 495 | |
| 496 | if (needFullChildrenNormalization) { |
| 497 | normalizeChildren(vnode, children) |
| 498 | // normalize suspense children |
| 499 | if (__FEATURE_SUSPENSE__ && shapeFlag & ShapeFlags.SUSPENSE) { |
| 500 | ;(type as typeof SuspenseImpl).normalize(vnode) |
| 501 | } |
| 502 | } else if (children) { |
| 503 | // compiled element vnode - if children is passed, only possible types are |
| 504 | // string or Array. |
| 505 | vnode.shapeFlag |= isString(children) |
| 506 | ? ShapeFlags.TEXT_CHILDREN |
| 507 | : ShapeFlags.ARRAY_CHILDREN |
| 508 | } |
| 509 | |
| 510 | // validate key |
| 511 | if (__DEV__ && vnode.key !== vnode.key) { |
| 512 | warn(`VNode created with invalid key (NaN). VNode type:`, vnode.type) |
| 513 | } |
no test coverage detected