(suspense: SuspenseBoundary, branch: VNode)
| 916 | } |
| 917 | |
| 918 | function 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 | |
| 937 | function isVNodeSuspensible(vnode: VNode) { |
| 938 | const suspensible = vnode.props && vnode.props.suspensible |
no test coverage detected