useMount ​
Hook that executes a callback when the component mounts
lifecycle
test coverage
Last changed: last month
Installation ​
Library
CLI
Manual
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 |
Type declaration ​
typescript
import type { EffectCallback } from 'react';
Source ​
Source • DemoContributors ​
D
H