Full API Surface

API Reference

Explore runtime hooks, signals, template syntax, CLI flags, and configuration properties.

RUNTIME HOOK
useState(initialValue)

Creates a fine-grained reactive state signal. Accepts a primitive value, object, array, or dynamic accessor function.

let count = useState(0);
let double = useState(() => count * 2);
RUNTIME HOOK
useEffect(fn, deps)

Executes side-effect logic whenever reactive dependencies inside the dependency array trigger mutations.

useEffect(() => {
console.log("Count changed:", count);
}, [count]);
LIFECYCLE
onMount(fn)

Runs after component DOM mounting completes. Optionally return a cleanup function to execute on unmount.

onMount(() => {
const timer = setInterval(...);
return () => clearInterval(timer);
});
ROUTING
<Link to="/path">

Client-side navigation component for zero-reload route switching without full browser reloads.

<Link to="/docs" class="nav-link">
Go to Docs
</Link>
CLI COMMAND
eronom init [dir]

Initializes a fresh Eronom project with pre-configured directory layout, standard routing, and HMR server.

$ eronom init docs
CLI COMMAND
eronom dev [dir]

Launches the native Rust dev server with instant HMR compilation on http://localhost:4000.

$ eronom dev .