Skip to content

useMount

Hook that executes a callback when the component mounts

lifecycle
necessary
test coverage
Last changed: 7 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

NameTypeDefaultNote
effectEffectCallback-The callback to execute

Type declaration

typescript
import type { EffectCallback } from 'react';

Source

SourceDemo

Contributors

D
debabin
debabin
H
hywax
hywax

Released under the MIT License.