Hakej / shopping-lizt-frontend

0 stars 0 forks source link

Change components tree structure #2

Open kansoft opened 1 year ago

kansoft commented 1 year ago

I've noticed that there is some little mess with component tree structure in the project

image

As you can see on above screen item.js is on root level in components directory, but the first component that you use in app.js level is ShoppingList that is in components/ShoppingList/ShoppingList.js. You should try reflect your files tree structure with component tree structure. You can move item.js to components/ShoppingList/ unless item.js is some kind of common component that will be use in other components as well. Then move item.js maybe to common/ folder.

Another approach to structure react application is Atomic Design Pattern which you can use also if you'd like :) Here you have a reference to material about this pattern https://medium.com/@janelle.wg/atomic-design-pattern-how-to-structure-your-react-application-2bb4d9ca5f97

Hakej commented 1 year ago

https://github.com/Hakej/shopping-lizt-frontend/pull/4