Skip to content

useClock

useClock(): number

Defined in: useClock.ts:16

Subscribe to the shared clock. Returns the current Date.now() and re-renders the calling component on every tick (1Hz).

Most consumers want one of the higher-level hooks (useCountdown, useTimeAgo) instead — those subscribe with a derived selector so the component only re-renders when the derived value changes, not on every tick.

Reach for useClock directly when you need raw timestamp access in render logic that genuinely should run every second.

number