LiveKit LogoDocs
Real-timeEgress/IngressCloudReference

useEnsureTrackReference

Ensures that a track reference is provided, either via context or explicitly as a parameter. If not inside a TrackContext and no track reference is provided, an error is thrown.

Import

import { useEnsureTrackReference } from '@livekit/components-react';

Parameters

#
track?TrackReferenceOrPlaceholder

Returns

TrackReferenceOrPlaceholder;

On this page

ImportParametersReturns

Previous

Chevron IconuseEnsureRoom
LiveKit Logo

Product

SFU

SDKs

Cloud Dashboard

Cloud Status

GitHub Logo