From the course: Next.js: Creating and Hosting a Full-Stack Site

Unlock this course with a free trial

Join today to access over 24,800 courses taught by industry experts.

Customizing content with route parameters

Customizing content with route parameters - React.js Tutorial

From the course: Next.js: Creating and Hosting a Full-Stack Site

Customizing content with route parameters

- [Instructor] All right, so at this point we're linking each of our product list items to its corresponding Product Detail page, but we have yet to implement our Product Detail page in a way that will actually display the product that we clicked on. So what we want to happen is when we click on one of these products, all right? So let's say it's the hat here. We want the hat to show up in the Product Detail page, but if we click on the mug, we want the mug to show up in the Product Detail page. Now, this can be a little bit tricky because how do we know what product we clicked on that brought us to the Product Detail page? Well, that's where something called route parameters comes in. And here's what route parameters are going to look like. Instead of just having a generic path such as product-detail for our Product Detail page, what we're going to want to happen is when we click on one of those products, we're going to want it to go to /products, and then have another segment here…

Contents