MCPcopy
hub / github.com/vuejs/core / setActiveBranch

Function setActiveBranch

packages/runtime-core/src/components/Suspense.ts:918–935  ·  view source on GitHub ↗
(suspense: SuspenseBoundary, branch: VNode)

Source from the content-addressed store, hash-verified

916}
917
918function setActiveBranch(suspense: SuspenseBoundary, branch: VNode) {
919 suspense.activeBranch = branch
920 const { vnode, parentComponent } = suspense
921 let el = branch.el
922 // if branch has no el after patch, it's a HOC wrapping async components
923 // drill and locate the placeholder comment node
924 while (!el && branch.component) {
925 branch = branch.component.subTree
926 el = branch.el
927 }
928 vnode.el = el
929 // in case suspense is the root node of a component,
930 // recursively update the HOC el
931 if (parentComponent && parentComponent.subTree === vnode) {
932 parentComponent.vnode.el = el
933 updateHOCHostEl(parentComponent, el)
934 }
935}
936
937function isVNodeSuspensible(vnode: VNode) {
938 const suspensible = vnode.props && vnode.props.suspensible

Callers 4

mountSuspenseFunction · 0.85
patchSuspenseFunction · 0.85
resolveFunction · 0.85
mountFallbackFunction · 0.85

Calls 1

updateHOCHostElFunction · 0.90

Tested by

no test coverage detected