Skip to content

Commit 66df197

Browse files
authored
Fix useTrackRef (#692)
1 parent 01611f5 commit 66df197

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.changeset/olive-olives-flow.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@livekit/components-react": patch
3+
---
4+
5+
Fix `useTrackRef` for certain cases.

packages/react/src/hooks/useTrackMutedIndicator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function useTrackMutedIndicator(
4242
options: UseTrackMutedIndicatorOptions = {},
4343
): TrackMutedIndicatorReturnType {
4444
let ref = useMaybeTrackRefContext();
45-
const p = useMaybeParticipantContext() ?? options.participant;
45+
const p = useMaybeParticipantContext() ?? options.participant ?? ref?.participant;
4646

4747
if (typeof trackRefOrSource === 'string') {
4848
if (!p) {

0 commit comments

Comments
 (0)