Next.js Discord

Discord Forum

Best practice for shared/non-shared components

Unanswered
Bracco Italiano posted this in #help-forum
Open in Discord
Bracco ItalianoOP
Hey guys - wondering about what makes sense in terms of a convention.

For components shared between routes I place them inside of a components dir inside the /src/ folder, however if components are specific to a particular route/page, do you tend to keep them inside the components folder or do you make components directories in the route that the components are going to be used in?

What is best practice here?

1 Reply

American Chinchilla
Personally, if its only for a single page, i dont make it a component. But if it appears in a single page a lot, then i would just add it to the components folder.