How to do it...

  1. First, we need to create a Post folder in the root of the project. We need to also create an index.js and a styles.js file in the new Post folder. We will use this Post component to display each post for our app. Finally, we need to add a data.json file to the root of the project, which we will use to define a list of posts.
  2. Now we can move on to building the App.js component. First, we need to import the dependencies for this class. We are going to use a ListView component to render the list of posts. We'll also need Text and View components for content containers. We are going to create a custom Post component to render each post on the list, and we will also need to import the data.json file:
import React, { Component ...

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

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.