Categoryperformance
All hooks13 guides

Performance Hooks

Debounce, throttle, stable callbacks, and render diagnostics without stale closures.

PerformanceIntermediateSSR-safe

useDebounce

Debounce a changing value (alias of useDebouncedValue).

import { useDebounce } from '@/hooks';
hooks/performance/useDebounce.tsOpen guide
PerformanceIntermediateSSR-safe

useDebouncedValue

Return a value that updates after a quiet period.

import { useDebouncedValue } from '@/hooks';
hooks/performance/useDebouncedValue.tsOpen guide
PerformanceIntermediateSSR-safe

useLatest

Always-current ref — kills stale closures.

import { useLatest } from '@/hooks';
hooks/performance/useLatest.tsOpen guide
PerformanceIntermediateSSR-safe

useRaf

requestAnimationFrame loop with start/stop.

import { useRaf } from '@/hooks';
hooks/performance/useRaf.tsOpen guide
PerformanceIntermediateSSR-safe

useRenderCount

Count how many times the component rendered.

import { useRenderCount } from '@/hooks';
hooks/performance/useRenderCount.tsOpen guide
PerformanceIntermediateSSR-safe

useStableCallback

Stable function identity that calls the latest fn.

import { useStableCallback } from '@/hooks';
hooks/performance/useStableCallback.tsOpen guide