2025-04-30 08:33:57 +08:00
|
|
|
export let insertionParent: ParentNode | undefined
|
2025-04-23 15:43:58 +08:00
|
|
|
export let insertionAnchor: Node | 0 | undefined
|
2025-03-10 16:18:02 +08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* This function is called before a block type that requires insertion
|
|
|
|
* (component, slot outlet, if, for) is created. The state is used for actual
|
|
|
|
* insertion on client-side render, and used for node adoption during hydration.
|
|
|
|
*/
|
|
|
|
export function setInsertionState(parent: ParentNode, anchor?: Node | 0): void {
|
|
|
|
insertionParent = parent
|
|
|
|
insertionAnchor = anchor
|
|
|
|
}
|
|
|
|
|
|
|
|
export function resetInsertionState(): void {
|
|
|
|
insertionParent = insertionAnchor = undefined
|
|
|
|
}
|