useParticipants
The useParticipants
hook returns all participants (local and remote) of the current room.
Import
import { useParticipants } from "@livekit/components-react";
Remarks
To optimize performance, you can use the updateOnlyOn
property to decide on what RoomEvents
the hook updates.
Usage
const participants = useParticipants();<ParticipantLoop participants={participants}><ParticipantName /></ParticipantLoop>;
Properties
options?
UseParticipantsOptions
Returns
(import('livekit-client').RemoteParticipant | import('livekit-client').LocalParticipant)[]