Fractal Project Structure with React and Redux - pros/cons [closed] Fractal Project Structure with React and Redux - pros/cons [closed] reactjs reactjs

Fractal Project Structure with React and Redux - pros/cons [closed]


The one drawback or con I've encountered with a similar structure is if/when things starts being used outside of it's hierarchy, then you have to use a lot of ../../.. in your imports.

For example, say that you get the requirement that on your StartPage route you should show the details for the most recent event.

so now it looks like:

routes├─Events│     ├─New│     ├─Details├─StartPage       ├─ components   // here somewhere you import ../../Events/Details

It's not the end of the world, but your nice hierarchy isn't quite as strictly hierarchical anymore.


The one drawback that I can speak to is not being able to at a glance view all available routes and their respective components, this can be mitigated by making some descriptive comments, but it does increase the complexity of your route configuration. I would also try to keep nesting folders to minimum since there is cognitive load associated with getting the levels of nesting right in your import statements i.e ../../../../../these can get out of hand if you have many nested routes.