Founding price: $35, then $99 after 23:59 UTC on 4 November, then $99
Get ProFollow a fast-changing value at most once per interval, applying the first change at once and the latest one when the interval ends.
Derived from this item’s props table, because it declares no controls of its own. This item has no standalone playground, so changes update the code, the share link and the AI prompt.
Use it when a value changes continuously (a slider, a scroll position, a pointer) and a costly render or request should run at a steady rate, not wait for the person to stop.
Do not use it to wait for typing to settle; that is useDebouncedValue.
import { useThrottledValue } from "@/hooks/use-throttled-value"const [position] = useState(0)
const throttled = useThrottledValue(position, 200)useThrottledValue<T>(value: T, interval = 200): T
| Name | Type | Default | Description |
|---|---|---|---|
value | T | - | The live value. |
interval | number | 200 | Minimum milliseconds between updates of the result. |
The first change after a quiet interval is applied immediately (leading edge). Changes inside the interval are held, and the newest one is applied when the interval ends (trailing edge). The timer is cleared on unmount.
A hook has no markup. If the throttled value is announced to a screen reader, announce the throttled one, not the live one, so it is not flooded.
The hook ships with renderHook tests (use-throttled-value.test.ts) covering its behaviour, cleanup on unmount and server-safe defaults. It is safe to render on the server.