5 ms·
I prefer using fractal-style component structure, avoiding folders like `components` for single-use components. It looks like this: src/ App/ scree
by zheksoon 5y ago
I prefer using fractal-style component structure, avoiding folders like `components` for single-use components. It looks like this:
src/
App/
screens/
Login/
component.tsx
index.tsx
model.tsx
styles.scss
Dashboard/
SomeDashboardPart/
component.tsx
index.tsx
SomeOtherDashboardPart/
component.tsx
index.tsx
helpers/
someHelper.tsx
component.tsx
index.tsx
model.tsx
components/
Button/
component.tsx
index.tsx
`model.tsx` files here are MobX data models used for this specific component
- kakuri 5y agoI have a bit of a preference for this approach as well, but having worked on numerous large projects I have to agree with Josh's arguments against it. Maybe on a small personal project it can succeed but on large ongoing projects I favor organizing by function rather than feature.
- bern4444 5y agoAh yes, so if I have three component.tsx files open in different tabs its impossible to tell which one is which