Skip to content
GaudiGaudi Design System home

Search documentation

Search every page, heading and paragraph.

useIsMounted

A stable getter for whether this hook is currently mounted.

HooksEnvironment@gaudi/design-system/hooks/environment/use-is-mountedView in StorybookSource

Returns a getter that is false during server rendering and before its mount effect, true while mounted and false after cleanup. Checking it does not cause a render.

Usage

import { useIsMounted } from '@gaudi/design-system/hooks';
const isMounted = useIsMounted();

Examples

Playground

Storybook

API

1 return value

Accessibility

Keep pending, success and cancellation feedback visible to users.

Notes

  • This does not cancel work or protect against stale responses after props change. Prefer AbortController or request identity for those cases.
  • Use useIsClient for a reactive hydration flag. React Strict Mode replays effects in development.