From the course: Next.js 14 from Scratch: Build a Real-World Project Using Next.js 14 and MongoDB
Unlock this course with a free trial
Join today to access over 25,200 courses taught by industry experts.
Display search results - Next.js Tutorial
From the course: Next.js 14 from Scratch: Build a Real-World Project Using Next.js 14 and MongoDB
Display search results
All right, guys, so we're able to fetch the search results. You can see them down here in the console. Now we want to obviously show them in the page. So let's come back to our page here. This is property slash search results slash page JSX. And I'm going to get rid of this console log. And then let's start to bring in some other things that we need. So we're going to bring in the link component. So link from next link. And we're going to have an arrow component, because I do want to have a back to properties link. So that's going to be, what is it? F-A, I think it's arrow, F-A arrow alt. Yeah, circle left is what we want. And then let's bring in the property card, because that's how we're going to display our properties. And then finally, we'll bring in the spinner. And then let's go down to the return. And let's see, we'll get rid of that. And we're going to say return. And then if it's loading, then we'll show the spinner. We have to pass the loading into the prop here. Else, then…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.