What’s the big deal with React Native?
Alright. Let’s get real. A lot of the jobs I’ve come across recently ask for React.
Sometimes I wonder if recruiters are just throwing the library into the required experience list because it’s one of the latest buzz words. Perhaps they’re just casting a wide net to catch that unicorn candidate.
It’s hard to tell.
Whatever the reason for having React in the job description, I decided to check out the library and properly play with it.
Coming from an Angular background, the most probable equivalent to React Native is Ionic and NativeScript.
But there’s more to React Native than that.
So, what’s the big deal with React Native?
React Native takes React one step further. It uses React and employ React like syntax but is actually a stand-alone framework that uses the phone’s platform (i.e. Android and iOS) native APIs to render certain code components.
This makes app development faster and more cost-effective than building the same app in isolation for separate platforms. While there may be some discrepancies in getting the UI to render in exactly the same way on both iOS and Android, the logical layer is transposable and reusable.
For many developers living in the world of Windows, development for iOS can be a bit of a pain, especially if you don’t have the hardware for it. In theory, a Mac is required to build your app for any iOS device. React Native, however, bypasses this through the Expo client app. You’ll still need an Apple phone or an iPad to test. If you have neither of these devices on hand, React Native helps cut down on the hardware investment.
Expo — the open-source device bridge
Expo is another framework that sits on top of React Native, a sort of scaffold around your React Native app that turns your code into a universal React app.
When it comes to React Native, you can develop your app without Expo. But with Expo, it cuts down on the platform restrictions of iOS faced by non-Mac owners.
Expo’s main role in the app development process is to coordinate physical device and emulator testing. You can also test out web apps, but when it comes to React Native, most developers tend to predominantly use it for device-based development.
What you essentially do is create your Expo app via the CLI and preview your project through an app downloaded onto your testing device.
For Expo to work, your development machine and the testing device are required to be connected to wi-fi. This connection is used to facilitate the auto-compiling and hot reloading of your app on your testing device when code is changed and saved.
The quirks of React Native
Everything has its quirks, especially when it makes grand promises like being cross-platform. When we anchor ourselves with only the good parts, it makes us oblivious to the annoying bits — until we personally encounter them.
While major companies Facebook, Bloomberg and Skype may be using React Native in production, these apps are not 100% React Native. Rather, React Native only makes up a small component of it and is implemented in a scattered approach.
Although React Native has been around for about 4 years, it is still young by comparison and developers often face issues of package incompatibility. The custom module ecosystem is still quite small, with many still sitting in beta versions.
There are also very little out of the box support for native app functionalities such as camera and push notifications, features which are highly sought after in app development. This means that using React Native doesn’t cut out the need for platform knowledge.
Who’s actually using React Native?
When it comes to React Native, you need to know a lot of things to make it work properly. However, the same can be said for any kind of web and application development.
React Native is just another way for developers to turn ideas into interfaces and experiences. It’s not the end-all holy grail of everything, but it does cut down on a lot of things.
Discord, for example, uses React Native to deliver its iOS app but remains loyal to Android development. UberEATS migrated their app development to React Native for code reusability, which ended up surpassing their overall expectations.
But the move to React Native has not been all rosy, with the most public migration out from React Native being Airbnb. While UberEATS managed to figure out how to move faster with React Native, Airbnb felt the opposite effect due to organizational structures and current code infrastructure.
However, React Native does offer itself up as a strong contender for commercial projects.
Partial implementation is possible with React Native, meaning that your app doesn’t have to entirely in the framework to work. It can be ported into native apps for rendering parts of the application through components.
So is React Native worth the hype?
It really depends on your current application and development. It appears that React Native is not a one-hit solution that covers all scenarios and cases, but it can have the potential to be that framework that efficiently and effectively covers the groundwork for both iOS and Android.