Exports
DOM runtime exports — h, Fragment, text, createRoot.
h
Creates DOM elements or renders components.
// Element
h("div", { class: "container" }, [h("p", {}, ["Hello"])])
// Component (function)
h(Greeting, { name: "World" }, [])When the first argument is a function, it's called as a component with props (including children if provided).
Fragment
Groups children without a wrapper element.
h(Fragment, {}, [child1, child2, child3])In JSX: <><Child1 /><Child2 /></>
text
Returns a string for text nodes. The compiler uses this for interpolated text.
createRoot
Mounts a component and handles re-renders.
let root = createRoot(document.getElementById("root"))
root.render(App)After render, Lattish will re-render whenever component state changes (via useState, etc.).
Custom host (non-DOM targets)
createRoot takes an optional second argument — a host config — so the same hooks and
reconciler can drive a target other than the DOM (a terminal, a canvas, a test shadow tree).
Omit it and Lattish uses the built-in DOM host unchanged.
createRoot(container, host).render(App)A host is a plain object implementing the node operations the reconciler calls. The shape mirrors react-reconciler's host config:
Each root remembers its own host, so DOM roots and custom-host roots can coexist in one app.
Lattish 2.0 is built on the tish 2.0 toolchain (
@tishlang/tish ^2.0.0).