Websocket server error in ionic 5 react

I am using ionic react ,
After using ionic-native/web-server in react it gives type error , after finding solutions in GitHub for this plugin , they says to use plain javascript, how to implement this in react ionic.
Any comments would be extremely helpful I have been struggling since ages.