1. 1
    Fetch REST data using React Query’s useQuery hook
    3m 30s

Fetch REST data using React Query’s useQuery hook

Domitrius Clark
InstructorDomitrius Clark

Share this video with your friends

Send Tweet

We're going to quick dive into how to utilize useQuery to fetch some data for us, set up a loading state, and display it in our JSX. We'll also wire up the React Query Devtools and discuss some features.

Craig Doremus
Craig Doremus
~ 5 months ago

I understand that the recently released react-query version 3 made some significant changes to the API. How do those changes affect the code examples shown here?

I've done some work on this myself and found that when react-query is updated from version 1.0 to 3.5, there are significant differences in the API and Dev Tools. Working code for this example can be found here: https://codesandbox.io/s/egghead-react-query1-bxsc4?file=/src/App.js

An upgrade guide to version 3 can be found here: https://react-query.tanstack.com/guides/migrating-to-react-query-3