Convex with React Native without Expo
Is the support for projects outside of expo not present since the documentation only mentions expo
9 Replies
I use Expo so I can't say from experience, but it should work fine with React Native.
Happy to help troubleshoot if you give it a shot and run into anything.
Just after a quick scan, I believe everything in the Expo quickstart applies to a non-Expo React Native project except the first step (generating the expo app).
Not sure if there are differences in the Babel step, but Expo and React Native both use Metro, so I think they both use Babel as well.
this is the error i'm getting with same implemenation just instead of react-native-dotenv i'm using react-native-config
hmm yeah you don't want react-dom attempting to load in a native app, curious what's happening there
my bad i missed
react-dom
Actually I see it in my dependencies too, so convex must be conditionally loading it for web only
oh that's not a runtime error from react-dom, it's saying it can't resolve the module
hmm
Not sure if what you're seeing is pnpm specific, but I'd try:
1. nuking node_modules and reinstalling
2. if 1 doesn't work, as a troubleshooting step, try installing react-dom as a direct dependency
that's what I did, i see no errors.. will try mutation and query now..
Convex should work with non-expo React Native, but the react dom dependency is needed. The Convex React client uses
ReactDOM.unstable_batchedUpdates
(which was necessary for compatibility with older version of React)Its working 🙌
🙌