Hiyve Components - v1.0.0
    Preparing search index...

    Function useRoom

    • 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.

      Returns { isInRoom: boolean; isOwner: boolean; room: RoomInfo | null }

      Object containing room info, isOwner boolean, and isInRoom boolean

      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>
      );
      }