#next13.4

1 messages · Page 1 of 1 (latest)

rugged dove
#

how to organize so all "page.tsx, layout.tsx" is in one seperate folder?

fading gustBOT
#

Hi @rugged dove. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

rugged dove
#

i have question
in next 13.4 we use /app/ folder where you can put page.tsx, layout.tsx etc.
But can you move components used outside the folder "app" ?
atm i do things like this

fading gustBOT
#

Hmm, I don't know enough to give you a confident answer yet. However, you can refer to the Next.js documentation for more information on organizing your project structure:


Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

Create your first page and shared layout with the App Router.

Route Groups can be used to partition your Next.js application into different sections.

#

@thorn schooner kapa.ai is still learning and improving, please let us how it did by reacting below

rugged dove
#

my suggestion is ... if possible or not
like keep the pages folder for the "server" components and the other junk in a separate folder.

Would this be possible?

so its
next-app
/ app
. / components
. / hooks
. / types

/ pages
api /
listings [listingId] / page.tsx
layout.tsx
page.tsx

golden totem
#

I’m not really sure your question

#

Pages and layouts can’t exist outside the app folder

#

Why would you even want to do this

#

If your question is regarding components in general

rugged dove
#

like, im just thinking of the idea. And looking at Vercel's example "commerce" i think they nailed it .

app / all page.tsx files etc.
components - components
libs - things that isn't page.tsx

golden totem
#

Yes that’s the standard practice

rugged dove
#

yea i was unsure about it