SSE Hooks

useUnmount

Custom hook that runs a cleanup function when the component is unmounted.

Installation

npx sse-tool add use-unmount

Usage

import { useUnmount } from "./{hooks file}";

useUnmount(() => {
  // Cleanup logic here
});

API

Parameters

NameTypeDescription
funcFunctionThe cleanup function to be executed on unmount.

Changelog

c165d — feat: enhance useRoleGuard and useSSR hooks with additional options and documentation

30da4 — feat: add new hooks and their metadata

cf13e — feat: add custom hooks for step navigation, ternary dark mode, timeout, toggle, unmount, and window size

Built with Love • © 2026