ITADN

useIsMuted implementation supports 2 parameters, but TypeScript definitions only allow 1

#1277OpenMirzahmet 创建于 2026-01-30
M
Mirzahmetcommented
### Select which package(s) are affected \@livekit/components-react ### Describe the bug Hi @1egoman @lukasIO! It looks like there is a mismatch between the runtime implementation and the published TypeScript types for useIsMuted in @livekit/components-react. The actual implementation supports the following overload: `useIsMuted(source: Track.Source, options: { participant: Participant })` However, the public type definitions only expose: `useIsMuted(trackRef: TrackReferenceOrPlaceholder): boolean;` This results in a TypeScript error when using the second, documented usage pattern: `TS2554: Expected 1 arguments, but got 2` ### Reproduction ` import { useIsMuted } from '@livekit/components-react'; ` `import { Track } from 'livekit-client';` `const isMuted = useIsMuted(Track.Source.Camera, { participant, });` This works at runtime but fails TypeScript type checking. ### Logs ```shell ``` ### System Info ```shell Environment @livekit/components-react: "^2.9.19" TypeScript: "~5.9.3" ``` ### Severity blocking all usage of LiveKit ### Additional Information Expected Behavior Either: The public .d.ts file should include the second overload, or The documentation/examples should only reference the trackRef-based usage.
0 条评论