Skip to content

Documentation / @agentick/core / useOnMount

Function: useOnMount()

useOnMount(callback): void

Defined in: core/src/hooks/lifecycle.ts:31

Register a callback to run when the component mounts.

Parameters

callback

MountCallback

Returns

void

Example

tsx
useOnMount((ctx) => {
  console.log("Component mounted");
  ctx.setState("initialized", true);
});

Released under the ISC License.