Search

Four Approaches to React Native

Josh Justice

5 min read

Dec 12, 2018

Four Approaches to React Native

One of the challenging things about evaluating React Native as a technology is that there are multiple ways to use it, each with their own pros and cons. This can make it hard to interpret what folks say about React Native online: if they’re taking a different approach than you will, they might be describing a benefit you won’t get, or a problem you won’t run into.

Even if you’re aware of these alternative ways to use React Native, it can be difficult to wade through the technical implementation detail to understand the tradeoffs. To help with this, let’s take a look at four “personas” describing people in different business situations. We’ll assess their needs and see which React Native approach is the best fit for each.

See if one of these sounds a lot like your situation. Big Nerd Ranch would be happy to help you develop an app with any of these approaches!

1. Expo

You’re a startup founder and you are all-in on the “lean startup” mindset. You haven’t settled on an exact product; instead, you’re trying to find product/market fit. You intend to change your mind weekly, if not daily. “Feedback” is your operative word: you need to get ideas out there as quickly as possible, find out if users like them, and then make the next change.

If this is you, Expo could be a great fit for you. It’s an all-in-one platform for building and releasing React Native apps as quickly as possible with minimum overhead. You don’t even need to publish your app through an app store to get users to try it: you can just send them a link or QR code to open your app in Expo’s hosting application. Expo also provides built-in support for deploying updates to users over-the-air instantly without going through an app store release process. The reason you can do all this is because of Expo’s full-featured suite of native functionality included out of the box. The flip side of this benefit, though, is that if you do need a native integration that isn’t provided out of the box, Expo’s architecture doesn’t allow you to add new native integrations via custom code or third-party libraries. This won’t hinder you forever, though—if you find that you can’t proceed within Expo’s feature set, you can eject to get access to all of React Native’s normal extensibility.

Expo

2. React Native CLI

Your company has a successful web presence and an internal web team. You want to release mobile apps to provide additional features to your users—but you don’t want to triple your development team size. Consistency of experience is important to you, so you’d like the same feature teams to be able to build out features for both the web and mobile, rather than some platforms lagging months behind others.

If this is you, the “standard” React Native experience of the React Native CLI may be best for you. (You can learn about React Native CLI by going to React Native’s “Getting Started” page and clicking “Building Projects with Native Code”.) The CLI allows you to create a new React Native app that has full access to the normal iOS and Android project directories and configuration. This gives you the ability to easily add third-party libraries that provide new native integrations that aren’t available in React Native otherwise. In this approach, it’s a great idea to hire or consult with at least one experienced native developer for each platform you want to release on. They can build out any custom native integrations that aren’t available in third-party libraries, as well as providing tooling support to your web developers. But most of your feature development will be able to be done by your web team using the React paradigm they’re familiar with.

React Native CLI

3. Existing Native App

You worked with a consultancy to build out your mobile app on one or more platforms, but now you’re having trouble maintaining it. Your web devs can’t work in it, you’re having trouble hiring native devs, and engaging a consultancy off-and-on is expensive and high overhead. So now the app is falling behind your web app, and it’s missing features your competitors have added. You’re glad you have a native app, because you take advantage of things like notifications and offline storage. But none of the rest of your features requires a native app, so the high maintenance cost is frustrating.

If this is you, you could benefit from “integrating React Native with an existing app”, as described on React Native’s website. Your app continues to run as before, but it also hooks in to React Native. This allows you to build out new screens in React Native, or migrate existing screens to React Native one at a time. Ideally, you’ll still have one experienced native developer for each platform your app runs on, but this will enable your web developers to make major strides enhancing your app.

Existing Native App

4. Component Library

You have an existing native team for one or both mobile platforms, and they’re doing great. You want them to keep doing what they’re doing—they’re specialists. But there are other parts of the app that don’t require that kind of specialization, parts that seem slow to change, parts that are expensive to keep on par with the web. You want the web devs to be able to contribute without adding hurdles to the way your native developers work.

If this is you, you could benefit from putting your React Native components into a library, most famously described by Artsy as their “component pod” approach. In this approach, React Native components are built out in a standalone library that is imported into the main app—in their case, using the CocoaPods package manager. The rest of the app can be ignorant that React Native even exists. This protects your native developers’ experience allowing them to do what they do best, and it also provides sandboxed areas where web developers can work.

Component Library

Conclusion

Choosing one of these four ways to use React Native isn’t a once-for-all decision. If you find that your needs have changed, you can migrate your app toward having a more normal native implementation, or replace native implementation with React Native screens. But it’s a good idea to evaluate these approaches to React Native and choose the one that is the best fit for your business situation.

Big Nerd Ranch would be happy to talk with you to learn about your business and help steer you to the best approach to React Native for you, so you can make a decision about it with more confidence you understand the tradeoffs. Reach out to us—we’re looking forward to talking with you!

Josh Justice

Author Big Nerd Ranch

Josh Justice has worked as a developer since 2004 across backend, frontend, and native mobile platforms. Josh values creating maintainable systems via testing, refactoring, and evolutionary design, and mentoring others to do the same. He currently serves as the Web Platform Lead at Big Nerd Ranch.

Speak with a nerd

Schedule a call today! Our team of nerds are ready to help

Let's Talk

Related Posts

We are ready to discuss your needs.

Stay in Touch WITH Big Nerd Ranch News