How to do it...

  1. We'll start by creating an images folder and adding basket.png to it. Also, create an empty file in the root of the project called sales.json.
  1. Inside the sales.json file, we'll define the data that we're going to display in the list. Here's some sample data:
    "items": 5,
    "address": "140 Broadway, New York, NY 11101",
    "total": 38,
    "date": "May 15, 2016"
  1. To avoid cluttering the pages of this book, I've only defined one record, but go ahead and add more content to the array. Copying and pasting the same object multiple times will do the trick. In addition, you could change some values on the data so that each item displays unique data in the UI.
  1. In our App.js file, let's import the dependencies we'll need:
import ...

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

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