Liveblocks provides real-time collaboration infrastructure with conflict-free shared state (CRDTs), presence awareness, and a React hook API. Its LiveObject, LiveList, and LiveMap types enable concurrent editing without merge conflicts.
0 / 5 completed
1 / 5
What is a Room in Liveblocks?
A Room in Liveblocks is the core unit of collaboration. It is identified by a string ID and acts as a self-contained session where users share presence (cursor positions, etc.), storage (CRDT-based shared state), and can broadcast events. Users join and leave rooms as they navigate your application.
2 / 5
What does the useOthers() hook return in a Liveblocks room?
useOthers() returns an immutable list of presence objects for every other connected user. Each entry has a presence property (typed from your room config) and connectionId. It is the primary hook for rendering live awareness UI like collaborative cursors, avatar stacks, and 'who is viewing this page' indicators.
3 / 5
What are Liveblocks conflict-free data types (CRDTs)?
Liveblocks CRDTs — LiveObject, LiveList, and LiveMap — are the building blocks of shared storage. They use CRDT algorithms so concurrent edits from multiple users are merged automatically and deterministically without requiring a central conflict resolution step or operational transforms.
4 / 5
What does the useMutation() hook do in Liveblocks?
useMutation() wraps a function that receives a MutationContext giving access to storage and presence. All storage modifications inside the callback are batched into a single network update. The returned stable function reference can be called from event handlers, unlike hooks which cannot be called conditionally.
5 / 5
What does useStorage() return in Liveblocks and how is it updated?
useStorage(selector) reads a slice of the room's shared CRDT storage and returns an immutable (frozen) snapshot. The component re-renders whenever the selected slice changes due to any user's edit. To write, you use useMutation() — this separation of reads and writes prevents accidental direct mutations of the CRDT.