-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
When trying to run WarpDrive inside a React Native environment (as part of an experiment), the current implementation fails because it directly accesses browser-specific globals like window.addEventListener and document.visibilityState.
TypeError: window.addEventListener is not a function
TypeError: Cannot read properties of undefined (reading 'visibilityState')
Missing DOMExceptionThese occur inside:
- RequestSubscription (listening for visibility and network events)
this.isHidden = document.visibilityState === 'hidden';
React Native doesn’t have window or document, so these assumptions cause failures even though the rest ofWarp Drive (signals, store, request manager, etc.) works fine once the environment is polyfilled.
How other libraries solve this
TanStack solves this by exposing onlineManager and focusManager - https://tanstack.com/query/v5/docs/framework/react/react-native. You can then use your React Native libraries to update their states
Metadata
Metadata
Assignees
Labels
No labels