The risks and rewards of React Native for Android
React Native checks all our clients’ boxes. It promises to save developers time and clients money. It promises to make training developers easier. And most importantly, it promises to create both iOS and Android apps from one set of code. It’s no surprise then that React Native is growing fast. But at Table XI, we’ve seen a lot of cross platform solutions with big promises. And while we love new tools, we tend to be cautious of the risks.
That’s why we’ve been testing React Native.
One of our longest-running clients, Dickson, came to us wanting an Android app to go with the iOS app we built 3 years ago. We figured this would be a perfect low-risk opportunity to test out some of React Native’s promises. We’d build an app for Android, and, if things went well, we could then use the same codebase to upgrade the iOS app. Here’s what we’ve learned so far, so you can decide if React Native is right for you …
How React Native Works
Facebook adapted its React web framework into React Native after it faced challenges building mobile apps with HTML5. It has been testing React Native for over a year now, and made the framework open source in April 2015. The new framework included a lot of potential benefits …
React Native makes it easier to train web developers
A single codebase makes it easier to update the apps
Aside from the development time it would save you at the start, using one set of code for both Android and iOS apps means only running maintenance on one set of code. You wouldn’t have to worry about the apps displaying different information or having different bugs — you’d make updates in one place to keep both experiences working.
React Native is straightforward and requires less code
In other native languages like Swift or Java, there’s a lot of boilerplate code that’s needed to do simple things. React Native strips that down, so the codebase isn’t as cluttered and developers can work faster. It also simplifies the connection between the data on a server and the view on your phone screen, so information is updated automatically and there are fewer places where the code can fail.
React Native gives you two apps for less cost
React Native’s cross-platform promise — that you get two apps from one set of code — doesn’t quite mean that you get two apps for the price of one. It’s more like two apps for the cost of one-and-a-quarter, since there’s additional development required. But that’s still a lot less than what you’d pay for individual Android and iOS apps. For clients like Dickson, who need to run both Android and iOS apps, the cost savings from a working cross-platform solution could be huge.
Finding developers who don’t need training is a challenge
Want all the best React Native tools in one stack? Download your free copy of our own mobile development stack.
Learning a new framework can be time consuming
At this point, React Native is so new that everybody is still learning it to some extent. The framework is changing, so it takes work to make sure we’re doing things according to current best practices. In Dickson’s case, this risk was worthwhile because there wasn’t a hard deadline. We had the time to experiment and learn. A new technology like React Native might not be a good fit for a company needing a tight turnaround though, unless they’re working with a development shop that already has the experience.
React Native still has some catching up to do as a tool
The React Native community hasn’t solidified like it has for more established frameworks. There aren’t as many agreed upon tools or best practices yet, so you’ll likely have to go back and update your code in a few years after React Native has had time to mature — though all good developers will update their code periodically, no matter the framework.
Certain features just aren’t supported yet
React Native is adding new features all the time, but there are still gaps. We were able to work around these missing pieces, but it does add time to the project. This is already improving, as the community works to fill the gaps Facebook left by contributing modules. In some cases these modules have even been pulled into the main React Native codebase. As of this winter, more than half of the updates to React Native were coming from community contributors or other companies that use the language, like Airbnb.
Developers need to be mindful of potential cross-platform issues
Android and iOS have a different look and feel, and developers will have to plan for that if they want to reuse as much code across platforms as possible, saving time and money. You have to be cognizant of what things should look like on each platform and adapt the code to make the apps feel native.
Our experience using React Native for Android
Overall, we’ve had a really positive experience working in React Native. The ramp up wasn’t that difficult, and we’ve been pleased with the code structure. The logic of the React framework is really excellent, and it makes developing fun. Building in Android has been great, and while we haven’t yet pushed an iOS version, the cross-platform capabilities look promising.
The only real hangup with React Native is its newness. The community is still maturing, so there aren’t as many third-party tools and solutions we can rely on when some functionality isn’t available. That said, React Native does let you sidestep the framework if you need to do something that’s not supported yet. In our project with Dickson, for example, we had to build a chart that displayed temperatures. React Native doesn’t have this functionality yet, so we plugged an existing Android charting component into the framework to make it work. Being able to pull iOS or Android tools does a lot to make up for the missing pieces that come with a new framework. We can get what we need now while we wait for React Native to mature and add more features.
React Native going forward
Given the success we’ve seen so far, we’re planning to keep working with React. We’re going to iterate on this app for Dickson and try using our React Native codebase to replace the iOS app. We’ll let you know how the cross-platform functionality works in a future blog post.
If you find the promise of getting both Android and iOS apps outweighs the potential risks, React Native could be a great fit for your business. If you want to know more about our experiences so far, contact us , and we’ll help you decide if it’s right for your project.
Published in mobile app