adrianhajdin/project_video_chat

TypeError: userVideo.current is undefined

Ayman220 opened this issue · 1 comments

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

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

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

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

fixed by removing the null