Build your first Valyrian.js application
Follow one root view from its first render through removal.
The example keeps a greeting visible in `body` until the user chooses Unmount application, which removes the mounted root.
Table of contents
Main APIs
- v
- Creates the vnode description that Valyrian.js renders as part of a view.
- mount
- Starts a Valyrian.js application on a DOM target.
- unmount
- Ends the mounted application lifecycle.
tsximport { mount, unmount } from "valyrian.js";
const App = () => (
<main>
<p>Hello, Valyrian.js</p>
<button onclick={() => unmount()}>Unmount application</button>
</main>
);
mount("body", App);Limit
`mount` requires a valid target. Use `unmount` to remove the mounted root.