-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Native support #184
Comments
When migrating to react 18(New RN architecture forces to use React 18), It seems like b52c5f9 can be RN not to work properly because of importing |
Is it specific functionality that won’t work for version 4 in react native or will it just plain not work? Is it not advised to use this in a react native application? I see there is a flag in the current code base for checking if we are in a react native environment to prevent EventSource feature in React Native. Which makes me think that ReactNative should be supported for useWebsocket? react-use-websocket/src/lib/constants.ts Line 35 in f8d9821
|
I tried using this library in a react-native app and it mostly works for my use case. The only issue I have is that I can't set headers for the http upgrade request that occurs before switching protocols. This is an issue in iOS at least where the user agent header is not set and therefore the request gets blocked in the WAF. I forked this repository to solve it for now but would love to see that feature getting added in. Is there any plans to do so @robtaussig? |
I was trying to add this lib to a RN project but I've face some strange behaviour when installing with the dependency tree ! Then I can't add it to my expo project ( SDK 51 ) 😢 |
Hi, I didn't see anywhere in the docs whether or not this library is assumed to be compatible with React Native. It might be helpful for those choosing a websocket library for their project to say if there are any known incompatibilities, or if it's good to go.
This library:
Sumit1993/react-native-use-websocket#27
says it works, but I haven't tested.
The text was updated successfully, but these errors were encountered: