When building a site, we will most likely be working with APIs, or Application Programming Interface, to send and receive information that is displayed on our site. On the frontend with JavaScript and React, to send and receive the data to manipulate, we use a fetch request.

The return of a fetch request is a promise which means we don’t know if it will be fulfilled or not and even if it’s fulfilled, it might not be fulfilled right away. However, the class component is going to try and render the page right away. So we need a way for…

Cassandra Parisi

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store