How to use path params with next.js app router #shorts

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
so often when you're building out an application with next.js's app router you need a way to encode data in the URL itself one approach that we can do to do that is by using path parameters for example if you have a Blog and you want a URL that says post slash post ID how would you get that ID from the URL well the way that you do that is that in your directory itself you can put these brackets here and you can put a identifier to basically extract that information from the URL when someone were to be navigated to that page and after you put those brackets you actually get access to different parameters that are passed into components in the prop so in this case we'll have parameters of post ID and we can render that out to the page over here so let's go to a page called post slash hello world and notice that hello world is going to print directly in the center of the page
Info
Channel: Web Dev Cody
Views: 22,094
Rating: undefined out of 5
Keywords: web development, programming, coding, code, learn to code, tutorial, software engineering
Id: NVfhhfhFHUg
Channel Id: undefined
Length: 0min 46sec (46 seconds)
Published: Tue Jul 04 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.