From 622f57a3c09f5a0f7ee853fb50af33f7da1bfb37 Mon Sep 17 00:00:00 2001 From: ocupe Date: Mon, 6 Nov 2023 17:20:38 +0100 Subject: [PATCH 1/2] fix useTrackRef --- packages/react/src/hooks/useTrackMutedIndicator.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react/src/hooks/useTrackMutedIndicator.ts b/packages/react/src/hooks/useTrackMutedIndicator.ts index 6788cbb8d..c28f18d4b 100644 --- a/packages/react/src/hooks/useTrackMutedIndicator.ts +++ b/packages/react/src/hooks/useTrackMutedIndicator.ts @@ -42,7 +42,7 @@ export function useTrackMutedIndicator( options: UseTrackMutedIndicatorOptions = {}, ): TrackMutedIndicatorReturnType { let ref = useMaybeTrackRefContext(); - const p = useMaybeParticipantContext() ?? options.participant; + const p = useMaybeParticipantContext() ?? options.participant ?? ref?.participant; if (typeof trackRefOrSource === 'string') { if (!p) { From 6e8a098515b1c135dddf87c7a29dbedba4373cee Mon Sep 17 00:00:00 2001 From: Jonas Schell Date: Mon, 6 Nov 2023 17:25:32 +0100 Subject: [PATCH 2/2] Create olive-olives-flow.md --- .changeset/olive-olives-flow.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/olive-olives-flow.md diff --git a/.changeset/olive-olives-flow.md b/.changeset/olive-olives-flow.md new file mode 100644 index 000000000..b2e5e5643 --- /dev/null +++ b/.changeset/olive-olives-flow.md @@ -0,0 +1,5 @@ +--- +"@livekit/components-react": patch +--- + +Fix `useTrackRef` for certain cases.