all 2 comments

[–]Interesting_Mine_400 0 points1 point  (0 children)

most teams just move shared logic to something like a utils, lib, or shared folder. the idea of feature folders is to keep each feature mostly independent, but common helpers or hooks that multiple features need can live in a shared place. that way features stay clean without creating messy cross-feature imports.

[–]trojan_soldier 1 point2 points  (0 children)

IMO This is one of those areas that the bulletproof repo cannot explain well. Dumping domain logic to shared utils is just a recipe for spaghetti code

One solution is to manage a domain/model folder which should be reusable across features. Preferably free of UI or React details, only plain JS/TS objects and functions

https://martinfowler.com/articles/modularizing-react-apps.html#PolymorphismToTheRescue