Grokking React Native
Vote

0% completed

​

Fetching Data with the Fetch API

How does a screen show data that it does not have yet? It shows something else first, starts a request, and renders again when the answer arrives. This lesson builds a Users screen that does exactly that, using fetch, the networking function that React Native provides. It needs no installation.

The examples use https://jsonplaceholder.typicode.com, a free practice server that returns sample data. Its /users address returns ten users.

A First Request

fetch takes a URL and returns a Promise, which is an object representing a result that will arrive later

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content