AgoraIO-Community / VideoUIKit-Web-React

A Web library to simply integrate Agora Video Calling or Live Video Streaming to your website with just a few lines of code.
MIT License
50 stars 40 forks source link

V2.1 #57

Closed digitallysavvy closed 2 months ago

digitallysavvy commented 2 months ago

If you change roles to audience, then come back to host, the camera and mic do not work

This issue was related to how the <videoCall/> and <TracksConfigure/> components are mounted and unmounted by the UIKit when the role changes. in React 18 the mount and unmounts are not as clear cut as older versions of React so when the <videoCall/> gets mounted as part of the audience flow and then remounted as part of the host flow it causes the component to mount and unmount which creates a shadow reference in the RTCConfigure so the leave channel is properly executed.

to resolve this issue, I moved the role logic from the main UIKit component to TracksConfigure component