Create new MediaStream() using react-native-webrtc-web-shim

I failed to create a new instance of MediaStream:

import { MediaStream, RTCPeerConnection } from 'react-native-webrtc-web-shim';
import { makeAutoObservable } from "mobx";
import { createContext, useContext } from 'react';

export class AppStore {
    localStream: MediaStream | null = null;
    remoteStream: MediaStream = new MediaStream();

i got:

Static Rendering Error (Node.js)
_reactNativeWebrtcWebShim.MediaStream is not a constructor

Perhaps you have forgotten to registerGlobals() first? Then, MediaStream will be available globally off the window and not through an import.

I don’t think so. As i have to build my app for both web and native devices, I guess I have to go to react-native-webrtc-web-shim, right? As follow to an webrtc youtube tutorial, in this step I have to create a new instance of browser MediaStream but because the tutorial is for browser/web only, using browser API, so I have to create a new instance of this library’s MediaStream instead. But yes i got the error. I already registerGlobals as you said but it differ that it come from shim lib, not core lib. And the shim lib is not yet support you from create a new MediaStream instance - in web.

btw, I struggle in finding a workable example - it either run into:
a) (0 , _index.requireNativeComponent) is not a function <====== no support react-native-web
b) _reactNativeWebrtcWebShim.MediaStream is not a constructor <====== failed to create an instance if running on web