-
Notifications
You must be signed in to change notification settings - Fork 139
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
make sure it works with react-native #516
Comments
I'm using partysocket in React Native and run into the "ReferenceError: Property 'Event' doesn't exist, js engine: hermes" error, since Event is not available in RN. When using the polyfill |
I had the same problem with import { EventTarget, Event } from "event-target-shim";
globalThis.EventTarget = EventTarget;
globalThis.Event = Event; |
this does not work for me |
Same, it's not working for me with |
so I assume it solved by #636 🫡 ? |
Ok, try this with the latest version of import "partysocket/event-target-polyfill";
import {usePartySocket} from "partysocket/dist/react";
// ... and use usePartySocket in your components Could any of you try this and lemme know if this works? I'm especially curious about production/release builds. |
Here's a solution that definitely works: Use https://www.npmjs.com/package/react-native-use-websocket, and connect to url I'm going to investigate more and fix partysocket for react native, but this should unblock you folks for now. |
@threepointone I can confirm this works fine for me in React Native import "partysocket/event-target-polyfill";
import {usePartySocket} from "partysocket/dist/react";
// ... and use usePartySocket in your components |
Did you tested in release mode on Android/iOS? In my case on dev mode works fine, but wasn't able to connect in release mode. |
Same as you in Expo@50 but no issue with Expo@49. Probably the same issue as react-native-webrtc/react-native-webrtc#1503 (i link them so maybe they can solve it too) |
FWIW In Expo@50, with In the polyfill, Changing explicitely the import form |
Can confirm the above works for |
Update: Even |
The text was updated successfully, but these errors were encountered: