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.
Installation
Open inpnpm dlx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useUnmountedRef.jsonnpx shadcn@latest add https://shadcn-ahooks.vercel.app/r/useUnmountedRef.jsonyarn shadcn@latest add https://shadcn-ahooks.vercel.app/r/useUnmountedRef.jsonbun shadcn@latest add https://shadcn-ahooks.vercel.app/r/useUnmountedRef.jsonA 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 } |