Api referenceReact
useCursors
Returns a live snapshot of all other users' cursor positions in the room.
Signature
Returns
A Record mapping each other user's userId to their current UserCursor. Your own cursor is not included.
Re-renders
With interpolation enabled (the default), the hook drives a requestAnimationFrame loop and updates state once per animation frame while any cursor is moving, giving you smooth cursor positions at display refresh rate.
With interpolate={false} on the provider, the hook updates only when a cursor update arrives from the server (roughly the throttle rate, default 20/sec).
Usage
Requirements
Must be called inside a <FlockProvider>. Throws if used outside one.
See also
- Custom cursor rendering guide for HTML, Canvas, and SVG approaches