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

Displaying a list of items

Lists are everywhere: A list of orders on the user's history, a list of available items in a store, a list of songs to play; basically, any application will need to display information in a list.

For this recipe, we are going to display several items in a list component. We are going to define a JSON file with some data, then we are going to load this file using a simple require to finally render each item with a nice but simple layout.

Getting ready

Let's start by creating an empty app--in this case we will name it ListItems. We are going to need an icon to display on each item, so please download the assets for this recipe or use your own .png image.

How to do it...

  1. We will start by creating an src folder. Inside this ...

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