I used the getUserMedia function to get access to my camera and mic, but now I want to remove the access when I leave the particular page or component in react
const stream = await navigator.mediaDevices.getUserMedia({ video: videoConstraints, audio: true })
I tried to get access when the user accessed the component but now I want to switch off the entrance of media devices