Skip to content

useUnmount ​

Hook that defines the logic when unmounting a component

lifecycle
test coverage
Last changed: last month

Installation ​

Library
CLI
Manual
typescript
import { useUnmount } from '@siberiacancode/reactuse';

Usage ​

typescript
useUnmount(() => console.log('This effect runs on component unmount'));

Demo ​

Api ​

Parameters

NameTypeDefaultNote
callback() => void-The callback function to be invoked on component unmount

Returns

void

Source ​

Source • Demo

Contributors ​

D
debabin
debabin
H
hywax
hywax
G
Gorilla Dev
Gorilla Dev

Released under the MIT License.