fetch function allows you to easily make AJAX requests. It takes in a URL as an input and returns a
Promise that resolves to a
Response object. You can find more information about
A Promise represents the eventual result of an asynchronous operation, you can find more information about Promises here and here. Both axios and
fetch() use Promises under the hood. You can also use the
async / await syntax to reduce the callback nesting.
You can learn more about making AJAX requests from React components in the FAQ entry on the React website.