Anything designed to be re-usable (or conceptually re-usable) would go in a top-level folder. Anything designed to be tightly coupled to a component would go in that component’s folder. This applies to any resource type. If I have a component that is tightly coupled to a utility (such as a modal generator or a reducer that pushes JSX to a flashbar), it goes in the folder for that utility. Keep related files close.

Categorical folders can be split as your team finds most appropriate. You may find that src/utils/actions.ts is good enough, but you may want to promote your actions file to a src/actions directory if its scope becomes too large.

Senior front end engineer /

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store