Pulling in data for the app
Welcome back! Did you take a moment to look at our app code? Did you clone the repo from the chapter-3
branch, or did you create your own components following the broad strokes I described previously? Either way, I’m glad you’re here! Let’s fetch some data and use some state!
A quick reminder about the data we’ll be using: I set up GitHub Pages in the /docs
folder, which you can find here: https://github.com/PacktPublishing/Simplifying-State-Management-in-React-Native/tree/main/docs.
You can preview every JSON file right in the GitHub UI. You can also view the raw contents of any file by clicking the Raw button:
Figure 4.2 – GitHub UI with the Raw button circled in red
The text file visible after clicking this button is what you could see as an API response.
We’ll start with fetching the list of users. This list contains user IDs and links to user avatars. Our API depends on us to...