@rbxts/pretty-react-hooks
Version:
Useful hooks for @rbxts/react
28 lines (18 loc) • 442 B
Markdown
```ts
function useUnmountEffect(callback: () => void): void;
```
Calls the callback when the component unmounts. This is useful for cleaning up side effects.
- `callback` - The callback to call when the component unmounts.
- `void`
```tsx
function UnmountLogger() {
useUnmountEffect(() => {
print("Unmounting...");
});
return <frame />;
}
```