DEV Community

Discussion on: ReactJS File Structure

Collapse
 
bartmr profile image
Bartmr

I usually split UI from logic, and the logic is split according to the entities you have.

src/
--components/
----screens/ /* Has your screens and navigators (in case you're using React Native)
----ui-kit/ /* Has your UI-kit and your typography and color settings
----shared/ /* Has components that are shared between screens but are too tied up to a feature, so they cannot be in ui-kit. i.e. Login gate UI */
--logic/
----appointments/
------api.ts /* makes the HTTP requests and abstracts the outer layers from the transport layer */
------reducers.ts
------actions.ts
------types.ts
----shared/
------store/
--------root-reducer.ts
--------store.ts
------utils/
------app-shell/ /* stuff like error toasts and full-screen loading spinners */
--------reducers.ts
--------actions.ts
Collapse
 
winniebosy profile image
Winnie Magoma

Thanks..I have bookmarked this...