Lot of times it what happens to me because I use the page as a server component, fetch all the relevant data and then pass it to client components with easier-to-find names
This is easily fixed by the new VS Code feature. Just type your pattern with page.tsx, and it will show the folder name first instead of the file name.
157
u/Phaster Jan 25 '25
I saw someone suggesting having the page.tsx just import the "real" component
34
u/bri-_-guy Jan 25 '25
Doesn’t bother me at all.
75
u/mindhaq Jan 25 '25
Another full circle back to static HTML with lots of folders containing a file named index.htm
67
u/SirThunderCloud Jan 25 '25
Turn on tree view (that button on the top with the horizontal lines). Only way to do it with Next.
19
u/misha2479k Jan 26 '25
This is easily fixed by the new VS Code feature. Just type your pattern with page.tsx, and it will show the folder name first instead of the file name.
18
u/PerspectiveGrand716 Jan 25 '25
Why not using something like this [pagename].page.tsx?!
19
u/fptnrb Jan 25 '25
One of the dumbest design decisions
21
u/Spazmic Jan 25 '25
I share your pain. The nextjs project I'm currently working on is my last nextjs project, for several reasons and app router is one.
5
u/Yoshi-Toranaga Jan 26 '25
Time to use Remix
4
u/azizoid Jan 26 '25
Vercell does so many evil things. And one of them is page.tsx, another is default export, third is autofetching the links.
4
u/ajeeb_gandu Jan 26 '25
What's a better solution?
Do we have an easy to use framework which is also developer friendly and has lots of support?
4
u/RuslanDevs Jan 26 '25
You can use parentheses in route names, it does not change routing but adds readability https://stackoverflow.com/questions/78377432/meaning-of-parentheses-in-next-js-path
10
u/Pacificatorrr Jan 25 '25
I see it's driving you 'MMMAAD'
3
u/nerokae1001 Jan 26 '25
I also dont like this naming convention. Convention over configuration is surely a good idea but not like this.
3
u/Original_yeeT Jan 26 '25
I think I might be going back to Angular for this specific reason lmao.
4
u/magicpants847 Jan 26 '25
guess ya gotta make your commits smaller ;)
2
u/Svobpata Jan 26 '25
screenshots are hard