adrianhajdin / project_video_chat

This is a code repository for the corresponding YouTube video. In this tutorial, we're going to build and deploy a React Video Chat Application using WebRTC.
850 stars 392 forks source link

TypeError: userVideo.current is undefined #8

Closed Ayman220 closed 3 years ago

Ayman220 commented 3 years ago

answerCall/< ~/src/SocketContext.js:45

42 | }); 43 | 44 | peer.on('stream', (currentStream) => {

45 | userVideo.current.srcObject = currentStream; | ^ 46 | }); 47 | 48 | peer.signal(call.signal);

Ayman220 commented 3 years ago

Apparently I was initializing the stream to null in SocketContext const [stream, setStream] = useState(null);

fixed by removing the null