Tips for Successful App Development with React Native

By Maz Ahmadi · September 17, 2017


React Native is an impressive library for developing cross-platform mobile apps. Below are a few things that I wish I had known when I first started working with React Native.

Actively Develop on Both Platforms

This is a common mistake, and one that I made early on. I used to extensively develop features on iOS without testing them on Android during development. React Native is a multi-platform tool but there are lots of little things that behave differently on Android in comparison to iOS. It’s best to actively develop for both platforms early on in order to save yourself time and effort in the long-run.

Setup Automated Testing

One thing that I wished I did early on was to setup automated testing. As your app grows, the amount of time that it takes to manually test for regressions make it a daunting task. Get familiar with tools like Jest & Calabash. Figuring out your automated testing early on prevents bugs from sneaking past QA.

Test on Real Devices

If you’re planning to support multiple versions of iOS, or any version of Android, get real devices and use them for testing. Android has a myriad of variety when it comes to screen sizes, hardware, and manufacturer-variants of the Android OS. Continuous integration tools like Buddybuild make it easy to get your app out in the hands of real testers.

Don’t Be Afraid of Native Code

Consider learning Objective-C/Swift and Java/Kotlin. React Native a great tool that will speed up development for targeting multiple mobile platforms. At some point however, you may need to expose functionality that doesn’t exist in the core library. Thankfully, React Native’s JavaScript bridge has a pleasant API to work with. It’s even possible to integrate React Native views with an existing native app. Even if you don’t need to port functionality, doing so for fun will teach you about how React Native works under the hood. Getting a good understanding of the inner-workings of the library will make you a more successful React Native developer.

Monitor Native Logs

If you use native modules on Android, you should use Logcat to check for native warnings and errors. On Android, warnings and logs are not automatically bridged to the JavaScript runtime (as it is with NSLog on iOS). It is the responsibility of the developer to do so. Android Monitor greatly simplifies this task and will even let you analyze memory and CPU usage.

Upgrade React Native with Caution

Keep an eye on the RN community website. RN has a monthly release cycle. Since it is still a fairly new library, the APIs are changing quickly. Before updating to a new version in production, make sure that all of your dependent libraries are compatible with the RN version that you’re planning to upgrade to.

 

That’s it for now! If you have questions about React Native, or if you need help with your React Native project, feel free to get in touch.

comments


Leave a Reply