Skip to content

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

NameTypeDefaultNote
effectEffectCallback-The callback to execute

Type declaration ​

typescript
import type { EffectCallback } from 'react';

Source ​

Source • Demo

Contributors ​

D
debabin
debabin
H
hywax
hywax

Released under the MIT License.