File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @livekit/components-react " : patch
3+ ---
4+
5+ Use correct default states in useLocalParticipant hook
Original file line number Diff line number Diff line change @@ -25,19 +25,20 @@ export interface UseLocalParticipantOptions {
2525export function useLocalParticipant ( options : UseLocalParticipantOptions = { } ) {
2626 const room = useEnsureRoom ( options . room ) ;
2727 const [ localParticipant , setLocalParticipant ] = React . useState ( room . localParticipant ) ;
28+
2829 const [ isMicrophoneEnabled , setIsMicrophoneEnabled ] = React . useState (
2930 localParticipant . isMicrophoneEnabled ,
3031 ) ;
31- const [ isCameraEnabled , setIsCameraEnabled ] = React . useState (
32- localParticipant . isMicrophoneEnabled ,
32+ const [ isCameraEnabled , setIsCameraEnabled ] = React . useState ( localParticipant . isCameraEnabled ) ;
33+ const [ isScreenShareEnabled , setIsScreenShareEnabled ] = React . useState (
34+ localParticipant . isScreenShareEnabled ,
3335 ) ;
36+
3437 const [ lastMicrophoneError , setLastMicrophoneError ] = React . useState (
3538 localParticipant . lastMicrophoneError ,
3639 ) ;
3740 const [ lastCameraError , setLastCameraError ] = React . useState ( localParticipant . lastCameraError ) ;
38- const [ isScreenShareEnabled , setIsScreenShareEnabled ] = React . useState (
39- localParticipant . isMicrophoneEnabled ,
40- ) ;
41+
4142 const [ microphoneTrack , setMicrophoneTrack ] = React . useState < TrackPublication | undefined > (
4243 undefined ,
4344 ) ;
You can’t perform that action at this time.
0 commit comments