LiveKit docs › React components › Hooks › useTracks

---

# useTracks

The `useTracks` hook returns an array of `TrackReference` or `TrackReferenceOrPlaceholder` depending on the provided `sources` property. If only subscribed tracks are desired, set the `onlySubscribed` property to `true`.

## Import

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

```

## Usage

### Example 1

```ts
// Return all camera track publications.
const trackReferences: TrackReference[] = useTracks([Track.Source.Camera]);

```

### Example 2

```ts
// Return all subscribed camera tracks as well as placeholders for
// participants without a camera subscription.
const trackReferencesWithPlaceholders: TrackReferenceOrPlaceholder[] = useTracks([
  { source: Track.Source.Camera, withPlaceholder: true }
]);

```

## Properties

- **`sources`** _(T)_ (optional): 

## Returns

```typescript
UseTracksHookReturnType<T>;

```

---

This document was rendered at 2026-10-12T06:11:29.618Z.
For the latest version of this document, see [https://docs.livekit.io/reference/components/react/hook/usetracks.md](https://docs.livekit.io/reference/components/react/hook/usetracks.md).

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