TypeError: userVideo.current is undefined
Ayman220 opened this issue · 1 comments
Ayman220 commented
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
Apparently I was initializing the stream to null in SocketContext
const [stream, setStream] = useState(null);
fixed by removing the null