useTrackByName
function useTrackByName(name, participant?): VoiceTrackReferencePlaceholder;Defined in: packages/react/src/hooks/track/useTrackByName.ts:25
This function useTrackByName allows you to access a track by referencing its track name. Inside the function, it ensures that the a valid participant reference is available by checking for both a passed participant argument and,
Parameters
| Parameter | Type |
|---|---|
name | string |
participant? | unknown |
Returns
VoiceTrackReferencePlaceholder
Example
const trackRef = useTrackByName("tts", participant);
return <ParticipantTile trackRef={trackRef} />;