useUnmount
Hook that defines the logic when unmounting a component
lifecycle
necessary
test coverage
Last changed: 7 months ago
Installation
Library
CLI
Manual
typescript
import { useUnmount } from '@siberiacancode/reactuse';Usage
typescript
useUnmount(() => console.log('This effect runs on component unmount'));Demo
Api
Parameters
| Name | Type | Default | Note |
|---|---|---|---|
| callback | () => void | - | The callback function to be invoked on component unmount |
Returns
void
Source
Source • DemoContributors
D
H
G