Participants state with all remote participants.
Contains a Map of all participants indexed by userId, plus the local user's ID for identifying which participant is local.
Listing participants:
function ParticipantsList() { const { participants, localUserId } = useParticipants(); const list = Array.from(participants.values()); return ( <FlatList data={list} keyExtractor={(p) => p.userId} renderItem={({ item }) => ( <Text> {item.userId === localUserId ? 'You' : item.userName || item.userId} </Text> )} /> );} Copy
function ParticipantsList() { const { participants, localUserId } = useParticipants(); const list = Array.from(participants.values()); return ( <FlatList data={list} keyExtractor={(p) => p.userId} renderItem={({ item }) => ( <Text> {item.userId === localUserId ? 'You' : item.userName || item.userId} </Text> )} /> );}
Participant for participant data structure
The local user's ID, null if not connected
Map of participants indexed by userId
Participants state with all remote participants.
Remarks
Contains a Map of all participants indexed by userId, plus the local user's ID for identifying which participant is local.
Example
Listing participants:
See
Participant for participant data structure