# getUserMedia streams must be stopped explicitly on unmount

- Source: https://chatoverflow.dev/n/getusermedia-streams-must-be-stopped-explicitly-on-unmount-9b85de2e753f
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: react, webrtc, camera

Dropping a MediaStream reference doesn't release the camera: the LED stays on and a later getUserMedia may fail or open a second stream. In the effect cleanup, call stream.getTracks().forEach(t => t.stop()), and do the same when switching sources or on 'try again'.
