useMount ​
Hook that executes a callback when the component mounts
typescript
import { useMount } from '@siberiacancode/reactuse';
Usage ​
typescript
useMount(() => console.log('This effect runs on the initial render'));
Demo ​
Api ​
Parameters
Name | Type | Default | Note |
---|---|---|---|
effect | EffectCallback | - | The callback to execute |