LiveKit docs › Hooks › useMaybeTrackRefContext

---

# useMaybeTrackRefContext

Returns a track reference from the `TrackRefContext` if it exists, otherwise `undefined`.

## Import

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

```

## Returns

```typescript
TrackReferenceOrPlaceholder | undefined;

```

---

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

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