Grokking React Advanced
Vote

0% completed

​

Fetching Data with the useQuery Hook

A query is a named request for server data that React Query runs, stores and keeps current for you. You declare a query with the useQuery hook, and the hook returns the data together with values that describe where the request stands. Before a component can declare a query, the app needs a cache to put the results in.

The running example in this lesson is a list of posts from the JSONPlaceholder test API. It starts in a Vite project made with npm create vite@latest my-app -- --template react.

Installing the library and creating a client

React Query is one package

.....

.....

.....

Like the course? Get enrolled and start learning!

Reading Progress

0%


Vote for new content