@@ -4,7 +4,7 @@ import { participantTracksObservable } from '@livekit/components-core';
4
4
import { useObservableState } from './internal' ;
5
5
import type { Track } from 'livekit-client' ;
6
6
import { useMaybeParticipantContext } from '../context' ;
7
- import { useRemoteParticipants } from './useRemoteParticipants ' ;
7
+ import { useParticipants } from './useParticipants ' ;
8
8
9
9
/**
10
10
* `useParticipantTracks` is a custom React that allows you to get tracks of a specific participant only, by specifiying the participant's identity.
@@ -16,14 +16,14 @@ export function useParticipantTracks(
16
16
participantIdentity ?: string ,
17
17
) : TrackReference [ ] {
18
18
const participantContext = useMaybeParticipantContext ( ) ;
19
- const remoteParticipants = useRemoteParticipants ( { updateOnlyOn : [ ] } ) ;
19
+ const participants = useParticipants ( { updateOnlyOn : [ ] } ) ;
20
20
21
21
const p = React . useMemo ( ( ) => {
22
22
if ( participantIdentity ) {
23
- return remoteParticipants . find ( ( p ) => p . identity === participantIdentity ) ;
23
+ return participants . find ( ( p ) => p . identity === participantIdentity ) ;
24
24
}
25
25
return participantContext ;
26
- } , [ participantIdentity , remoteParticipants , participantContext ] ) ;
26
+ } , [ participantIdentity , participants , participantContext ] ) ;
27
27
28
28
const observable = React . useMemo ( ( ) => {
29
29
if ( ! p ) {
0 commit comments