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 {
25
25
export function useLocalParticipant ( options : UseLocalParticipantOptions = { } ) {
26
26
const room = useEnsureRoom ( options . room ) ;
27
27
const [ localParticipant , setLocalParticipant ] = React . useState ( room . localParticipant ) ;
28
+
28
29
const [ isMicrophoneEnabled , setIsMicrophoneEnabled ] = React . useState (
29
30
localParticipant . isMicrophoneEnabled ,
30
31
) ;
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 ,
33
35
) ;
36
+
34
37
const [ lastMicrophoneError , setLastMicrophoneError ] = React . useState (
35
38
localParticipant . lastMicrophoneError ,
36
39
) ;
37
40
const [ lastCameraError , setLastCameraError ] = React . useState ( localParticipant . lastCameraError ) ;
38
- const [ isScreenShareEnabled , setIsScreenShareEnabled ] = React . useState (
39
- localParticipant . isMicrophoneEnabled ,
40
- ) ;
41
+
41
42
const [ microphoneTrack , setMicrophoneTrack ] = React . useState < TrackPublication | undefined > (
42
43
undefined ,
43
44
) ;
You can’t perform that action at this time.
0 commit comments