From the course: TanStack Query: Efficient Data Fetching and State Management
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Displaying data - TanStack Query Tutorial
From the course: TanStack Query: Efficient Data Fetching and State Management
Displaying data
- [Instructor] Right now, we have our GitHub profile component, but it's pretty minimal. It's just displaying this text and all of our data is actually being logged here to our console. So let's make some adjustments so that we're actually displaying that data and we need to make a change here on line 11 so that instead of returning that entire object to work with, we're going to de-structure a few specific keys that we want to work with. So isLoading, isEerror, data, and error should all be de structured from that response. And then in order for all of this to go away, we need to actually return something. So let's get rid of the console log. We're going to return our div, but we're going to make some adjustments to it. So let's wrap our entire return here. We'll say div, and then inside of that div, we'll add another div. Inside of that div, we'll add an image tag. Now this one is going to have a source. So where do we get the photo from? Well, it's actually from the API. So under…