Object containing isWaiting, roomName, timeout, and elapsedTime
import { useWaitForHost } from '@hiyve/rn-react';
function WaitForHostScreen() {
const { isWaiting, roomName, timeout, elapsedTime } = useWaitForHost();
if (!isWaiting) return null;
return (
<View>
<Text>Waiting for host to start "{roomName}"</Text>
{timeout != null && <Text>Timeout in {Math.max(0, timeout - elapsedTime)}s</Text>}
</View>
);
}
Subscribe to wait-for-host state.
When a user joins a room before the host has started it, they enter a waiting state. This hook provides the waiting status, room name, and timeout information.