10
Consuming the REST API with React
This chapter explains networking with React. This is a really important skill that we need in most React apps. We will learn about promises, which make asynchronous code cleaner and more readable. For networking, we will use the fetch
and Axios libraries. As an example, we will use the OpenWeather and GitHub REST APIs to demonstrate how to consume RESTful web services with React. We will also see the React Query library in action.
In this chapter, we will cover the following topics:
- Promises
- Using the
fetch
API - Using the Axios library
- Practical examples
- Handling race conditions
- Using the React Query library
Technical requirements
The following GitHub link will be required: https://github.com/PacktPublishing/Full-Stack-Development-with-Spring-Boot-3-and-React-Fourth-Edition/tree/main/Chapter10 ...
Get Full Stack Development with Spring Boot 3 and React - Fourth Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.