AK0020
onMount() called outside of component setup
What happened
You called onMount() outside of a defineComponent() setup function. AkashJS needs an active component context to register lifecycle hooks.
How to fix
Move the onMount() call inside defineComponent()'s setup function.
Example
ts
// Bad
import { onMount } from "akashjs";
function startTimer() {
onMount(() => console.log("mounted")); // no component context!
}
// Good
import { defineComponent, onMount } from "akashjs";
const Timer = defineComponent(() => {
onMount(() => {
console.log("mounted");
});
return () => h("div", {}, "Timer");
});