LiveKit docs › Hooks › useRoomContext

---

# useRoomContext

Ensures that a room is provided via context. If no room is provided, an error is thrown.

## Import

```typescript
import { useRoomContext } from "@livekit/components-react";

```

## Returns

```typescript
Room;

```

---

This document was rendered at 2026-06-07T11:32:58.421Z.
For the latest version of this document, see [https://docs.livekit.io/reference/components/react/hook/useroomcontext.md](https://docs.livekit.io/reference/components/react/hook/useroomcontext.md).

To explore all LiveKit documentation, see [llms.txt](https://docs.livekit.io/llms.txt).