Host
Layout
An element handed to somebody else's code, with a lifetime. mount: runs once with the node, update: again whenever the state it reads changes, and cleanup: when the page, branch or list item it belongs to leaves.
Host(mount: …, update: …, cleanup: …)
Example
Host(tag: "canvas", mount: (node) => node.getContext("2d"), cleanup: (ctx) => log("gone"))
Renders with the class wf-host, stable across releases, so a stylesheet may target it.
| Prop | Type | Meaning |
|---|---|---|
| mount: | Any |
|
| update: | Any |
|
| cleanup: | Any |
|
| tag: | String |
The element to make, |
Attribute families: global, aria, data. Plus the universal props on every element: animate:, exit:, speed:, class:, ref:.