Any tutorials or blog posts on using ReactNative with Meteor?

Hi, I found this really helpful : https://themeteorchef.com/tutorials/how-to-build-a-react-native-app-with-meteor

3 Likes

I’m stoked, expo looks amazing @a.com. I’m looking to take the expo + react-native-meteor path. Do you still think this course is worth while (since it doesn’t cover Meteor)?

Is there anything I can watch/read that’s current, and uses expo+react-native-meteor specifically?

Nice article comparing react-native-meteor and meteor-client-bundler. Looks like he has a course on Meteor + React Native – but don’t see expo. Also has a slack channel.

I think the most important question here is: “How much reactivity do I actually need”. Bc if you find that the answer is “very little” then why bother with meteor on the client at all?

2 Likes

I am quite used to Meteor’s Minimongo. What would be the alternatives to store local data in collection-like way?

We use redux. But you can also simply fetch your data in componentDidMount and keep it in the component’s state. Nothing wrong with that. No matter where you fetch/keep your data, the alternative to minimongo is plain js arrays/objects.

I use apollo+meteor to build a webapp (most react-native apps will need a back-end and accounts). Then I use expo + react-native + apollo to build a react-native app that connects to the meteor back-end.

expo actually uses apollo for their app:

I do miss minimongo sometimes and subscriptions require a few extra steps. But overall I like graphql and apollo-client. I get a ton of re-use between the webapp and it’s react-native version.

Then I use redux for “ui state”, then I keep any data coming from the back-end in apollo store.

1 Like

I would just use the Q&A section of that course, most issues you run into will be solved in there.

Otherwise, check out expo blog posts about upgrades:

The big difference is exp.json is now inside app.json

Otherwise, you use react-navigation in that course, and that has some minor updates too. Just keep and eye onthe Q&A section, and also check out react-navigation docs and issues. The differences are relatively minor and deal with names of properties for options you pass routers.

I would just take that course, then when you’re done look into connecting Meteor. Connecting react-native-meteor to an expo app is no different than connecting to a vanilla react-native app. But I’d tackle it one at a time, take the course, then read up on spencers posts, check out spencers boilerplate, and you should be good to go. I typically have two repos, one is the react-native app and the other is a meteor app. React-native-meteor will take a URL for the meteorapp. So you just host the meteor app somewhere, then feed your react-native app that URL, and they talk to eachother just like the browser would (albeit react-native-meteor has some syntax differences).

I’m pretty sure expo (or something like it) will be the future.

The only bummer about react-native is there doesn’t seem to be a truly solid UI library with everything you need (there is no antd or semantic-ui).

and ask stephen to do more react-native content! I’m hoping he does another advanced course with expo

1 Like

I do miss using $in and some simple query syntax sometimes

check out this guy in youtube. using apollo, react-native, express. Using Apollo is as easy as using Meteor. https://www.youtube.com/channel/UC7R7bcH9-KEBDiGNP1mZnmw/videos

My issue with using Apollo for this first mobile app is that it will be communicating with the same MongoDB as an existing Meteor app. In this case, why not just use that app’s server to talk to the db? Why add Apollo to the mix when my main app doesn’t use it? I would be adding a level of abstraction for no good reason.

1 Like

true that @aadams. For your use case now it doesn’t make any sense. I am however doing all my new apps with apollo & react native. Works great. There are some gotchas in integrating redux with apollo though.

Thank you so much for let us know.

I think it’s best to make your own thin API that will work with any data structures you currently need. Be it minimongo or simple arrays. If you’ve got the time, of course)

Do you find you need something custom beyond just using lodash?

Not exactly. I simply like to have a unified api to rule them all :grin:

It’s good buuuut yeah, you can’t use libraries which… sucks. badly. Also, another third-party getting my app’s code? nah thanks. it’s good to learn and that’s all I wouldnt recommend shipping to production with expo and if you prototype using expo’s features you will have to remove it when you want to ship it to production. So… I don’t recommend at all

Yup, I also got mixed feelings about Expo. At least, your first statement isn’t true. You can “eject” and continue working with a bare-bones React Native app. However, you would still be dependent on their libraries. Which is OK if it makes your life easier. BTW: Just found out that Expo is now also used for create-react-native-app. So it seems to be “officially supported” by the React team at Facebook.

I’m looking into making a React Native mobile app myself…

I thought the same thing – you’re tied into their way of doing this, they control the pace of change/updates (if you want to stay current), and they control the “controls” and API for the most point. It’s opininated, so you’ll be in a “Meteor” situation. I think I’m “OK” with that if it adds a lot of value, as Meteor does.

I read that too – but it seems by going react-react-native-app, you only get a subset of Expo – you’ll have to allow Expo to create the app if you want the full suite of tools/controls/abilities.

1 Like

Really? They’re adding new libraries every month. And most of the libraries are just ports of the most popular ones for the given functionality. For instance, their maps module is just airbnb’s maps. If you had to exit expo for some reason, you literally wouldn’t have to touch your map code.

And the only libraries you can’t use are ones the require react-native link… and again that’s only if expos SDK doesn’t already have it. Plus they’re making your expo app virtually identical to create-react-native-app, which is the defacto direction things are going. if you exit, you’re basically ending up with a CRNA.

This is one of the big issues with the programming community. They’d rather spend a month re-inventing the wheel because (1) “it would be good to know” or (2) you may hypothetically one day have to spend a couple weeks to change some underlying technology. Is anyone regretting not knowing how to run their own server system in their basement now that we have the cloud? Are people who never actually needed the fine grained control they planned for really glad they wasted their time “decoupling” to use 14 separate libraries? Is anyone who struggled through react-native 0.0.1 feeling like that time gave them a big ROI now?

Yes, maybe you don’t want to use expo. But first you should be quadruple checking that what your app needs are not do-able with expo. I honestly can’t think of many use cases where you need something outside of expo. From what I can see, the only very common thing missing at this point is a payment module which (1) you can get by with http instead of native and (2) is going to be included in the next release anyway. You can use any router you want. You have what you need for finger print scanning, barcode scanning, maps, file system, contacts system— and it’s all cross-platform out of the box. Maybe if somebody else is footing the bill, and they could care less about the cost, then yeah you can spend time cobbling all of these together and re-inventing the wheel, but I’m not sure how that’s a good business decision or a pleasurable developer experience.

For me, I’m not that interested in learning a bunch of stuff that is going to be abstracted in a month by things like create-react-native-app, expo, or some expo competitor. You have to pick and choose your “learning battles”. And ask yourself… in two months is this going to be abstracted away from what I need to be concerned about? Often the answer is yes. And I’m just not worried that the guys at Expo, who would run circles around your average react-native developer, are really that concerned about stealing the source code for you CRUD app.

Tbh, I feel like your post is the programming equivalent of fake news.

1 Like