()
| 23 | * By default, it is appended to the body; tests may move it elsewhere (e.g. into a scroll container, see scrollElement.ts). |
| 24 | */ |
| 25 | export function getMountNode(): HTMLDivElement { |
| 26 | if (!mountNode) { |
| 27 | mountNode = document.createElement("div"); |
| 28 | |
| 29 | // Unless we attach the mount-node to body, getBoundingClientRect() won't work |
| 30 | document.body.appendChild(mountNode); |
| 31 | |
| 32 | root = createRoot(mountNode); |
| 33 | } |
| 34 | return mountNode; |
| 35 | } |
| 36 | |
| 37 | /** |
| 38 | * Helper method for testing components that may use Portal and thus require cleanup. |
no outgoing calls
no test coverage detected