DEV Community

Discussion on: Simple React Folder Structure

Collapse
 
zwkang profile image
kang

sometimes i prefer add a pages floder, the pages components in their floder, common components save in globals components floder

  • components
  • pages
    • home
      • components

about the code save way.
some util code not too much reuse, how to use save those utils code in your project?

Collapse
 
pcofilada profile image
Patrick Ofilada

Yup, sometimes I changed my containers folder to pages folder and all my pages or screen related components sits there. And all of the reusable components are located inside components folder. Ex:

src/
   components/
      Button/
         index.tsx
         style.ts
      Card/
         index.tsx
         style.ts
   containers/
      Homepage/
         index.tsx
         style.ts
      Profile/
         index.tsx
         style.ts