Nextjs Nested Route/segment

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 o…


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

  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.


This content originally appeared on DEV Community and was authored by Vijay Kumar


Print Share Comment Cite Upload Translate Updates
APA

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/

MLA
" » Nextjs Nested Route/segment." Vijay Kumar | Sciencx - Saturday September 14, 2024, https://www.scien.cx/2024/09/14/nextjs-nested-route-segment/
HARVARD
Vijay Kumar | Sciencx Saturday September 14, 2024 » Nextjs Nested Route/segment., viewed ,<https://www.scien.cx/2024/09/14/nextjs-nested-route-segment/>
VANCOUVER
Vijay Kumar | Sciencx - » Nextjs Nested Route/segment. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/14/nextjs-nested-route-segment/
CHICAGO
" » Nextjs Nested Route/segment." Vijay Kumar | Sciencx - Accessed . https://www.scien.cx/2024/09/14/nextjs-nested-route-segment/
IEEE
" » Nextjs Nested Route/segment." Vijay Kumar | Sciencx [Online]. Available: https://www.scien.cx/2024/09/14/nextjs-nested-route-segment/. [Accessed: ]
rf:citation
» Nextjs Nested Route/segment | Vijay Kumar | Sciencx | 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.

You must be logged in to translate posts. Please log in or register.