useUnmount
컴포넌트가 언마운트될 때 콜백 함수를 호출하는 커스텀 훅입니다.
Code
Interface
typescript
function useUnmount(callback: () => void): void
Parameters
| Name | Type | Description |
|---|---|---|
callback | () => void | 언마운트 시 호출될 콜백 함수 |
Usage
typescript
import { useUnmount } from '@modern-kit/react';
const Example = () => {
useUnmount(() => console.log("unmount"));
return <>{/* ... */}</>;
};