T
TanStack17mo ago
ugly-tan

Any alternatives to Netinfo for RN?

[Resolved] I am trying to implement react-query for an Expo RN app, following the instructions here: https://tanstack.com/query/v5/docs/framework/react/react-native#online-status-management I have tried everything I can think of, but installing Netinfo causes the app to fail on startup with a "No callback found with cbID ..." error every time. None of the advice I've found has helped, so I'm wondering if anyone has successfully used a different library that might provide the same basic functionality needed for auto refetch.
React Native | TanStack Query React Docs
React Query is designed to work out of the box with React Native, with the exception of the devtools, which are only supported with React DOM at this time. There is a 3rd party Flipper plugin which you can try: https://github.com/bgaleotti/react-query-native-devtools
2 Replies
xenial-black
xenial-black17mo ago
Are you using Expo Go or a Development Build? I ask because NetInfo includes native code (non-javascript). So if you are using a Development Build, you would need to rebuild it after adding NetInfo. Expo Go would load it automatically, but as you likely are aware, Expo Go is not great for development long-term because it only works with the current version of expo and it updates a lot.
ugly-tan
ugly-tanOP16mo ago
I have tried with both. But I think the issue I was having was likely due to an unusual monorepo structure - I moved my app into a yarn monorepo and haven't had the issue again. I will mark my question resolved. Thank you!

Did you find this page helpful?