Object containing participants array, participantsMap for direct lookup,
localUserId, and participantCount
import { useParticipants } from '@hiyve/rn-react';
function ParticipantCount() {
const { participants, participantCount, localUserId } = useParticipants();
return (
<View>
<Text>{participantCount} participants</Text>
<FlatList
data={participants}
renderItem={({ item }) => (
<Text>{item.displayName}{item.odvisitors === localUserId ? ' (You)' : ''}</Text>
)}
/>
</View>
);
}
Access all participants in the current room.
Provides participants as both an array (for rendering lists) and a Map (for direct lookup by user ID), along with the total count and the local user's ID.