Search icon CANCEL
Subscription
0
Cart icon
Cart
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Full Stack Development with Spring Boot 3 and React - Fourth Edition

You're reading from  Full Stack Development with Spring Boot 3 and React - Fourth Edition

Product type Book
Published in Oct 2023
Publisher Packt
ISBN-13 9781805122463
Pages 454 pages
Edition 4th Edition
Languages
Author (1):
Juha Hinkula Juha Hinkula
Profile icon Juha Hinkula
Toc

Table of Contents (23) Chapters close

Preface 1. Part I: Backend Programming with Spring Boot
2. Setting Up the Environment and Tools – Backend 3. Understanding Dependency Injection 4. Using JPA to Create and Access a Database 5. Creating a RESTful Web Service with Spring Boot 6. Securing Your Backend 7. Testing Your Backend 8. Part II: Frontend Programming with React
9. Setting Up the Environment and Tools – Frontend 10. Getting Started with React 11. Introduction to TypeScript 12. Consuming the REST API with React 13. Useful Third-Party Components for React 14. Part III: Full Stack Development
15. Setting Up the Frontend for Our Spring Boot RESTful Web Service 16. Adding CRUD Functionalities 17. Styling the Frontend with MUI 18. Testing React Apps 19. Securing Your Application 20. Deploying Your Application 21. Other Books You May Enjoy
22. Index

Using the React Query library

In proper React apps where you make a lot of network calls, the use of third-party networking libraries is recommended. The two most popular libraries are React Query (https://tanstack.com/query), also known as Tanstack Query, and SWR (https://swr.vercel.app/). These libraries provide a lot of useful features, such as data caching and performance optimization.

In this section, we will learn how you can use React Query to fetch data in your React app. We will create a React app that fetches repositories from the GitHub REST API using the react keyword:

  1. First, create a React app called gitapi using Vite and select the React framework and JavaScript variant. Install dependencies and move to your project folder.
  2. Next, install React Query and axios using the following commands in your project folder (Note! In this book, we are using Tanstack Query v4):
    // install v4
    npm install @tanstack/react-query@4
    npm install axios
    
  3. ...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at £13.99/month. Cancel anytime