Best practice for naming component files in a Next.js 15
Unanswered
Yellow croaker posted this in #help-forum
Yellow croakerOP
What is the best practice for naming component files in a Next.js 15 App Router project?
Should the file name follow a convention like ‘splash-screen.tsx’ (kebab-case) or ‘SplashScreen.tsx’ (PascalCase)?
I noticed that in the documentation, some files like button.tsx and not-found.tsx use kebab-case. How should we decide on the naming convention for component files?
Should the file name follow a convention like ‘splash-screen.tsx’ (kebab-case) or ‘SplashScreen.tsx’ (PascalCase)?
I noticed that in the documentation, some files like button.tsx and not-found.tsx use kebab-case. How should we decide on the naming convention for component files?
2 Replies
@Yellow croaker What is the best practice for naming component files in a Next.js 15 App Router project?
Should the file name follow a convention like ‘splash-screen.tsx’ (kebab-case) or ‘SplashScreen.tsx’ (PascalCase)?
I noticed that in the documentation, some files like button.tsx and not-found.tsx use kebab-case. How should we decide on the naming convention for component files?
(reposted from off-topic):
first way >>>> second way.
why? [file system case sensitivity](https://nextjs-faq.com/module-not-found-due-to-case-sensitivity).
sure you can tweak git to get case sensitivity right but i'd rather just use something simple
first way >>>> second way.
why? [file system case sensitivity](https://nextjs-faq.com/module-not-found-due-to-case-sensitivity).
sure you can tweak git to get case sensitivity right but i'd rather just use something simple
Sun bear
kebab case is better.
Check out the way bulletproof react does it
https://github.com/alan2207/bulletproof-react/tree/master/apps/nextjs-app
Check out the way bulletproof react does it
https://github.com/alan2207/bulletproof-react/tree/master/apps/nextjs-app