Next.js Discord

Discord Forum

What folder structure convention applies here

Answered
Rhinelander posted this in #help-forum
Open in Discord
RhinelanderOP
Let say I have landing page with bunch of diffrent components that don't get reused.

Do I make new file for each section or do I make bunch of components for each section inside the file.

If i choose first i clutter my folders with bunch of components that get used just once, if i choose second one my file will be unreadable as it will take 2 minutes to find section that i need

Any best practices? What would you choose?
Answered by B33fb0n3
I would create a components folder inside this specific route and seperate the components from the main page.tsx. Like that I have my component at one place (in the route), that I also only need for the route and also have a clean page.tsx file 🙂
View full answer

6 Replies

Answer
RhinelanderOP
should components folder be prefixed with _components
@Rhinelander should components folder be prefixed with _components
Nah, they are not routable, so why making them private/excluded?
RhinelanderOP
Yeah you are right
happy to help