0

1st Question:

I saw some people that they are creating components folder inside a page folder **Example 1:

src/
  app/
     gallery/
            components
            page.tsx**

On the other hand, I preferred this structure **Example 2:

src/   
   app/
      gallery/            
            page.tsx
   sections/
      gallery/
            GalleryUploadForm.tsx
            GalleryPhotoList.tsx**

Which structure is better and why? Creating components inside a page folder or create a separate folder in src directory called sections and inside section I will create a gallery folder and here I can make all the sections or components for gallery page

2nd Question:

Which filename style should I use in nextjs 13 "foo-bar.tsx" or "FooBar.tsx"? When I used nextJs 12 I always use to write filename like "FooBar.tsx" and I saw others also but recently I notice that when nextJs 13 released every one writing the filename like "foo-bar.tsx", now I just want to know which convention is better and why?

I'm expecting to understand which structure is best for a large and industry level project.

Tech
  • 1
  • 2

0 Answers0