GuobaGuoba Utils

useMount

@guoba-ai/hook / useMount

Function: useMount()

function useMount(fn): void;

Defined in: useMount.ts:14

Run a callback once when the component mounts.

Parameters

fn

() => void

The callback to run on mount

Returns

void

Example

useMount(() => {
  console.log('Component mounted!')
})

On this page