Nextjs Nested Route/segment

Vijay Kumar - Sep 14 - - Dev Community

Right now in the morning at 7:26,I have learnt the nested routes or segment in Nextjs

To implement the nested routes is very simple in Nextjs in compare to Reactsjs we don't have to manually write the boilerplate code and install react router

  1. We only need to make folder in our app folder inside Nextjs Project then make a component inside that folder with name page.js page.js is a convention set by Nextjs, _when we do this a segment has been made with route name == folder name for example

Image description

our main folder is app where our project all code reside, now whenever we make any folder inside this app folder Nextjs convert that folder into a route/segment and the file inside that folder will be show by browser on screen so each folder inside app is a route for nested routes the process is same we have to make folder inside folder and Nextjs convert that into nested route Note:Folder name start with underscore doesn't make a route.

. . .
Terabox Video Player