Reputation: 35
So I have a main dashboard on my app, in which I have a sidebar navigation and content container. But since I`m new to next.js and unfamiliar with its routing system, I don't know how to implement content changing when a user uses sidebar navigation. Should I make a separate page for each navigation route?
Upvotes: 0
Views: 1451
Reputation: 3006
Yes, for each route your have to create a file in pages
directory.
/
you create the file pages/index.js
my-page
you create the file pages/my-page.js
path/my-page
you create the folder pages/path
and the file pages/folder/my-file.js
For more explanation you can read the documentation of Next.js on routing. And you can also follow the official tutorial to get basic knowledge of Next.js.
Upvotes: 1