React Native brings what developers are used to from React on the web — declarative self-contained UI components and fast development cycles — to the mobile platform while retaining the speed, fidelity, and feel of native applications.
What is React Native?
In 2015, Facebook announced an open-sourced React Native; it was already being used internally for their mobile engineering. React Native is a framework for building native mobile apps using React. This means you can use a best-in-class JavaScript library (React) to build your native mobile user interfaces.
How React Native Works
React Native provides a way to build native cross-platform mobile apps using JavaScript. React Native is similar to React in that it allows developers to create declarative user interfaces in JavaScript, for which it internally creates a hierarchy tree of UI elements or in React terminology a virtual DOM.
Whereas the output of ReactJS targets a browser, React Native translates the virtual DOM into mobile native views using platform native bindings that interface with application logic in JavaScript. For our purposes, the target platforms are Android and iOS, but community-driven efforts have brought React Native to other platforms such as Windows, macOS, and Apple tvOS.
Talent and technology leverage
On paper, using React for all frontend development unlocks seemingly limitless opportunities for leveraging both technology and talent. Indeed, this was one of our primary motivations in choosing React Native, and our results have proved more multifaceted than anticipated.
While we’ve enjoyed almost unequivocal success in leveraging talent across our React and React Native ecosystems, attempts to leverage technology have produced a more nuanced set of outcomes.
Benefits of React Native
Here are the benefits we observed with React Native:
- Productivity
95% of the codebase is shared between iOS and Android
No knowledge sharing is required, as each feature is implemented by a single team Developer experience is awesome. No need to restart the packager to see simple changes React Native is written in JavaScript. We can leverage programming skills/resources across the organization
- Code Sharing
FrontEnd/Presentation code can be shared between iOS and Android
Business logic (redux store) can be shared with Web applications as well
Lots of code reusability between platforms
- App-store approval
No need to go through the app store approval process. We can host the bundle on our own server and do over-the-air updates
- Time-to-market
Very fast, We have control over the release dates. Both platforms can be released on the same day and time
- Performance
React Native provides nearly identical performance to native Animations. React Native provides extremely smooth animations because the code is converted to native views before rendering
- UX
We can have platform-specific UI design Automation Same automation suite can run on both iOS and Android
Our observations
About cross-platform leverage fall into a few discrete themes:
- Developer portability: the ease with which product engineers can contribute to both React and React Native apps
- Solution portability: the degree to which the same technical solution (e.g. UI code, business logic code, frameworks) can be used in both a React and React Native application (with minimal additional complexity or abstraction)
- Community cohesion: the extent to which React and React Native developers can collaborate within a shared set of principles, ideologies, and paradigms
Making a difficult decision and learning from it
From there, we started a technical assessment to evaluate the feasibility of transitioning the apps completely to React Native.
We looked at the following criteria:
- Quickly ship & iterate after release
- Maintainability
- Accessibility
- Testability
- App performance
- Code shareability
The React Native team developed the platform alongside our app and exposed the native components and APIs that we needed to make it happen. Those components will benefit everyone building an app in the future.