LiveKit docs › Components › TrackLoop

---

# TrackLoop

The `TrackLoop` component loops over tracks. It is for example a easy way to loop over all participant camera and screen share tracks. `TrackLoop` creates a `TrackRefContext` for each track that you can use to e.g. render the track.

## Import

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

```

## Usage

```tsx
const trackRefs = useTracks([Track.Source.Camera]);
<TrackLoop tracks={trackRefs}>
  <TrackRefContext.Consumer>
    {(trackRef) => trackRef && <VideoTrack trackRef={trackRef} />}
  </TrackRefContext.Consumer>
</TrackLoop>;

```

## Properties

- **`children`** _(React.ReactNode)_: The template component to be used in the loop.

- **`tracks`** _(TrackReference[] | TrackReferenceOrPlaceholder[])_: Track references to loop over. You can the use `useTracks()` hook to get TrackReferences.

---

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

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