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 ...

Get React Native Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.