This content originally appeared on DEV Community and was authored by Vijay Kumar
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
- 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
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.
This content originally appeared on DEV Community and was authored by Vijay Kumar
Vijay Kumar | Sciencx (2024-09-14T02:16:16+00:00) Nextjs Nested Route/segment. Retrieved from https://www.scien.cx/2024/09/14/nextjs-nested-route-segment/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.