Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Add Component to structure #63769

Closed
guylepage3 opened this issue Mar 27, 2024 · 3 comments
Closed

Docs: Add Component to structure #63769

guylepage3 opened this issue Mar 27, 2024 · 3 comments
Labels
Documentation Related to Next.js' official documentation. locked

Comments

@guylepage3
Copy link

What is the improvement or update you wish to see?

First of all. This is hands down the best doc structure recommendations I've ever seen. 馃憦馃徎 Amazing work!

https://nextjs.org/docs/getting-started/project-structure

Having said that, there seems to be one item, the component folder and files structure, that imo should be added as well.

I currently am noticing folks colocating more and more their components into their app folder. I feel as though this should be the default recommendation and if there are any corner cases they can be mentioned below the structure recommendation.

Also, I have noticed about a 50/50 split of folks placing an index.ts file in their component folder and exporting from there.

I'm completely impartial to how this is handled but a recommendation from the Structure page would be extremely helpful.

Let's get this rolling and then I'll do a quick PR.

Is there any context that might help us understand?

The above description describes the issue and possible solution.

Does the docs page already exist? Please link to it.

https://nextjs.org/docs/getting-started/project-structure

@guylepage3 guylepage3 added the Documentation Related to Next.js' official documentation. label Mar 27, 2024
@balazsorban44
Copy link
Member

Hi, thanks for the suggestion, but the linked page is aimed to give you a description of the Next.js conventions/required file structure. Having a components folder is not required and might confuse if we recommend it. I.e. you can also colocate your components right next to page.tsx files as well, as these are ignored by Next.js.

Whether you want to use a components folder should remain a project-level consideration.

@guylepage3
Copy link
Author

That is illogical as the entire point of using a react project is fundamentally based upon the use of components. Your docs even suggest this. Are you suggesting that there should not be any components used to build a Nextjs project?

Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Documentation Related to Next.js' official documentation. locked
Projects
None yet
Development

No branches or pull requests

2 participants