თითოეული გვერდისთვის შექმენით ცალკე ფოლდერი pages
-ში. და თითოეულისთვის შექმენით ცალკე CSS & JSX ფაილები (არ დაწეროთ რომელიმე კონკრეტული გვერდის კოდი App.css
-ში)
src/
├── mock-data/
│ ├── products.json
│ ├── users.json
├── shared/
│ ├── Header.jsx
│ ├── Footer.jsx
│ ├── Layout.jsx
│ ├── Main.css
│ └── ...
├── pages/
│ ├── home/
│ │ ├── Home.jsx
│ │ ├── Home.css
│ │ ├── Banner.jsx
│ │ └── ...
│ └── about/
│ ├── About.jsx
│ ├── About.css
│ └── ...
├── lib/
│ ├── axiosInstance.js
│ ├── AuthContext.jsx
│ └── utils/
│ ├── formatDate.js
│ └── ...
├── App.jsx
└── ...
- Every shared component or style (that will be used in multiple pages by the whole app) goes into the
shared
folder - Everything (
jsx
+css
) about a particular page goes into the pages/<page> folder (the page component file itself and any smaller sub-components it uses, likeEditPage.jsx
might use a sub-componentEditForm.jsx
) - Just for the sake of consistency, always use named
export/import
(noexport default
).