Tempted to abandon React Native for native Android

I have been using React Native for the past few months and have been thoroughly enjoying it. My first React Native app has been deployed to the PlayStore and I currently have another in development.

I enjoy using APIs that are intuitive and expressive and React gives me that. Composing views declaratively with JSX is much more fun than constructing view hierarchies in code. This, combined with the ability to use Stylesheets to style views, has allowed me to create more beautiful interfaces than what I have been creating.

It took me a while to grok the React way of doing things but now that I believe that I have grasped it, developing apps with it is mostly smooth sailing. There are a few pain points using React Native, however.

The React Native core is relatively small. I suspect this is a good thing as it allows core developers and contributors to focus and not stretch their resources too thin, but the downside is that for much of the functionality that an app may require, you have to resort to third party components or build your own.

A lot of these components are awesome but the problem is that the quality is not guaranteed. You have to try them and see how well they work. Sometimes a bit of tinkering and tweaking may be necessary, the documentation may be lacking, or there may be incompatibilities between different components.

This takes a bit away from the from the joy of writing JavaScript code but the situation is improving. React now features the ability to automatically configure many plugins that require accessing the underlying platform. Overall, for me, the React Native experience has been positive.

Until now! My current project requires the ability to process and display images. I test the app on various devices ranging from Kit Kat to Marshmallow. It works well on Lollipop and Marshmallow but on an underpowered device running Kit Kat I have been having issues.

To support adding images to the projects, I integrated an image picker component. Sometimes when adding an image, the user interface would turn white for a few seconds and then reload, but not on the page I added the image from. I suspect this is due to memory issues. That particular device has about 512 MB of RAM. On devices with at least 1 GB, this is not a problem.

I am tempted to just not support Kit Kat in hopes that devices running at least Lollipop 5.0 would have enough memory, but I think back to the fact that there are apps with similar features running on the same low-powered device running well. Instagram on the device is fast and responsive.

Of all the issues I have had with React Native, this may be a deal breaker for me. I don’t like the idea of limiting the potential reach of the application due to inefficiencies with the tool that I am using. I googled a bit about optimizing memory with React Native but didn’t find anything. I see that with the latest React Native version 0.41, there is an experimental nodes feature that’s supposed to improve the efficiency of view rendering. I am curious as to if this would help but I am also apprehensive about using experimental technology.

Developing with React Native and dealing with a lot of native plugins has gotten me reacquainted a bit with the native side of Android development so I think I may be ready to get back to it. Hopefully, I can apply the best lessons from React Native to native Android development.

5 Replies to “Tempted to abandon React Native for native Android”

  1. Sad that Android turned out to be such a fraud. With users unable to update their own devices, developers have to worry about a vast number of people running outdated OSes.

Leave a Reply