T
TanStack17mo ago
flat-fuchsia

Testing Offline React Native

How do I test offline functionality in React Native? If I go offline, I don't get console logs or debuggers anymore. On the web, I can use the devtools and there is a button to mock offline behavior, but in React Native, none of the debuggers I've tried have this option.
1 Reply
flat-fuchsia
flat-fuchsiaOP17mo ago
I ended up making button for development-only that would toggle the onlineManager to off. This way the device is still online, but RQ is offline, so expo still works and I can see what is happening. Then I used the new AsyncStorage devtool plugin in Expo 50 to see my paused mutations. https://docs.expo.dev/debugging/devtools-plugins/
Expo Documentation
Dev tools plugins
Learn about using dev tools plugins to inspect and debug your Expo project.

Did you find this page helpful?