Previously on Learn React from Scratch Series: Learn React: Your First React Component ExplainedPreviously on
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.
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 employs React-like syntax but is actually a standalone 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 using Expo 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 use it predominantly 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 in 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 and is implemented in a scattered approach.
Although React Native has been around for about four years, it’s 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 is also very little out-of-the-box support for native app functionalities such as camera and push notifications, features that 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 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 the framework that efficiently and effectively covers the groundwork for both iOS and Android.