Skip to content

mount()

Attach a WhisqNode to a DOM element.

function mount(node: WhisqNode, container: Element): () => void
ParamTypeDescription
nodeWhisqNodeThe node to mount
containerElementTarget DOM element

() => void — dispose function that unmounts and cleans up all effects.

import { div, mount } from "@whisq/core";
const dispose = mount(
div("Hello Whisq"),
document.getElementById("app")!,
);
// Later: unmount
dispose();