ExploreUse cases

Performance & stale closures

Throttle, stable callbacks, latest ref, render debug.

PerformanceIntermediateSSR-safe

useLatest

Always-current ref — kills stale closures.

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

useStableCallback

Stable function identity that calls the latest fn.

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

useRenderCount

Count how many times the component rendered.

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

useRaf

requestAnimationFrame loop with start/stop.

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