useMount ​
Hook that executes a callback when the component mounts
lifecycle
necessary
test coverage
Last changed: 3 months ago
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