Skip to content

Function: useLockState()

@roomful/react


@roomful/react / useLockState

useLockState<TPresence>(key): LockState | null

Defined in: react/src/index.ts:1165

Subscribes to the resolved state of a single lock key (the lock-on-focus pattern: read holder to decide whether the local peer owns the key).

TPresence extends PresenceData = PresenceData

The room presence shape.

string

The lock key to observe.

LockState | null

The current lock state for the key, or null when it is free.