Introduction
In this section, you will learn the basics of networking in React. We will fetch data from public REST APIs and render the data from a response. If you are not familiar with the HTTP protocol or REST APIs, you can find more info in:
useEffect hook
The useEffect hook function can be used to perform side-effects in React function component. The side-effect can be for example, network request.
Promises
Handling Promise objects
Fetch
The Fetch API is a built-in feature in modern browsers that allows you to make web requests. It operates asynchronously and uses promises to simplify response handling. By default, the fetch function takes a URL as its first argument and sends an HTTP GET request if not specified otherwise.
Nasa example
Before using a REST API, it's essential to read its documentation. This will help you understand how to make API calls and how the response payload looks like.
Recipe list example
Recipe list
Env Variables
Environment variables are part of the environment in which a process runs and can be used to store configuration settings, system information, or other data that programs may need.