ParticipantContext
const ParticipantContext: Context<
| {
name?: string;
identity?: string;
isLocal?: boolean;
self?: boolean;
muted?: boolean;
speaking?: boolean;
quality?: ParticipantQuality;
}
| null>;Defined in: packages/react/src/components/participant/ParticipantContext.tsx:31
A reactive React primitive.
Example
// Basic — scope participant-aware children.
<ParticipantContext.Provider value={participant}>
<ParticipantName />
</ParticipantContext.Provider>
// Advanced — combine participant context with a participant loop.
function ParticipantRoster() {
const participants = useParticipants();
return (
<VoiceRoom agent={agent}>
<ParticipantLoop participants={participants}>
<ParticipantName />
</ParticipantLoop>
</VoiceRoom>
);
}