Why is enumerateDevices type not inferred in ReactNativeWebrtc?

17 Views Asked by At

I'm writing code for webrtc, and I'm following the manual, but there's something I don't understand.

  useEffect(() => {
    mediaDevices.enumerateDevices().then(data => {
      console.log('enumerateDevices 로그');
      console.log(data);
    });
  }, []);

Why is the type of result 'data' not inferred in enumerateDevices?

enter image description here

The reason why this is curious is that the data returned by getUserMedia in the same library is used for data inference.

useEffect(() => {
    mediaDevices
      .getUserMedia({
        audio: true,
        video: true,
      })
      .then(data => {
        console.log('getUserMedia 로그');

enter image description here

Check the screenshot above

The value returned by getUserStream is inferred to be of type MediaStream.

I'm curious about this, what's the problem? Or is there a good reason? I wonder why

I'm curious about this, what's the problem? Or is there a good reason? I wonder why

0

There are 0 best solutions below