Directory Organization

Learn how to organize the directory.

Since multiple parts of our code might send the same action, we need a place to share the action creator functions. A common pattern is to create a separate directory for all the action creators in the codebase. For smaller projects, it may be enough to group actions in files according to their usage in reducers:

actions/
  recipes.js  // Recipe manipulation actions
  auth.js    // User actions (login, logout, etc.)
  ...

But as our projects grow in size and complexity, we will subdivide our action creator directory structure even more.

Get hands-on with 1200+ tech skills courses.