O'Reilly logo

React Native Cookbook by Crysfel Villa, Stan Bershadskiy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Dealing with universal apps

One of the benefits of using React Native is its ability to easily create universal apps. We can share a lot of code for phone and tablet apps. The layouts might be different at some point, but we can reuse the small pieces for both devices.

In this recipe, we will build an app that runs on phones and tablets. The tablet version will include a different layout, but we will reuse the same internal components.

Getting ready

For this recipe, we will show a list of contacts. For now, we will load the data from a .json file; later on, in the book, we will explore how to load remote data from a REST API.

Let's open the following URL and copy the generated JSON to a file called src/data.json. We will use this data to render the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required