Access current room state.
Provides the room info object, whether the local user is the room owner, and whether the user is currently in a room.
Object containing room info, isOwner boolean, and isInRoom boolean
room
isOwner
isInRoom
import { useRoom } from '@hiyve/rn-react';function RoomHeader() { const { room, isOwner, isInRoom } = useRoom(); if (!isInRoom) return null; return ( <View> <Text>{room?.name}</Text> {isOwner && <Text>You are the host</Text>} </View> );} Copy
import { useRoom } from '@hiyve/rn-react';function RoomHeader() { const { room, isOwner, isInRoom } = useRoom(); if (!isInRoom) return null; return ( <View> <Text>{room?.name}</Text> {isOwner && <Text>You are the host</Text>} </View> );}
Access current room state.
Provides the room info object, whether the local user is the room owner, and whether the user is currently in a room.