shadcn-ahooks

useUnmountedRef

A Hook can be used to get whether the component is unmounted.

Overview

A Hook can be used to get whether the component is unmounted.

Documentation and Examples

Installation

Open in
pnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useUnmountedRef.json
npx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useUnmountedRef.json
yarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useUnmountedRef.json
bun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useUnmountedRef.json

A Hook can be used to get whether the component is unmounted.

Examples

Default Usage

API

const unmountRef: { current: boolean } = useUnmountedRef();

Result

| Property | Description | Type | | - | ---- | | unmountRef | Whether the component is unmounted | { current: boolean } |

On this page