Facebook’s React Native iOS framework helps the social network keep its focus on the most important element of a mobile app: the user interface.

The user interface should inform every decision made when building a client application for the Web or a mobile platform, said Adam Wolff in his OpenAir 2015 presentation. Wolff is engineering director of product infrastructure at Facebook.

Wolff said that while this goal sounds obvious, many ideas about building applications are a holdover from a time when software applications didn’t put the user experience first. “We need to turn that around and build applications starting with the user interface,” he said.

React Native is a library Facebook developed for writing user interfaces for mobile devices; it’s currently limited to iOS. React Native is designed to enable the building of app experiences on native platforms using a consistent developer experience based on JavaScript and React, Facebook’s JavaScript library for building user interfaces. Facebook has open-sourced both React Native and React on GitHub.

Wolff showed examples of how Facebook used its React Native framework to display user profile pictures (go to 3:18 in the video to hear more) and comments (9:02 in the video).

React Native first showed up in Facebook’s iOS Groups application, Wolff said. Facebook used a conventional UI development kit to build some parts of the app and React Native to build others. “I challenge you to figure out which is which,” he told the audience. (18:32 in the video.)

Facebook also built its Ads Manager iOS app with React Native. A Web team built the app “without having to learn IOS,” Wolff said. He added that this enabled ad developers to write the Ads Manager app instead of people who are simply iOS or Android developers.

The same team that built the Ads Manager iOS app also developed the Android version using Facebook’s React Native for Android framework, Wolff noted. Over 85 percent of the code in the Android version of the app is identical to the code in the JavaScript version. “Even though we made it really easy to change the user interface based on the platform, we ended up reusing a bunch of the code anyway, and the team was able to ship this app in a couple of months,” Wolff said.

Want to work with us? We're hiring!