3 ms·
Yeah, the Redux docs and example projects showed "folder-by-type" for years ( `/reducers`, `/actions`, etc). But, as part of the ongoing Redux docs rewrite, we
by acemarke 6y ago
Yeah, the Redux docs and example projects showed "folder-by-type" for years ( `/reducers`, `/actions`, etc). But, as part of the ongoing Redux docs rewrite, we now specifically recommend "folder-by-feature" instead [0], as well as using a single "ducks/slice" file for all the Redux logic of a given feature.
Agreed that a couple top-level "types" folders may be useful for more generic/reusable code.
I do have a small Next project set up at my day job, and it does seem like it encourages a "folder-by-type" approach based on the use of `/pages`. But, I set up a `/features` folder alongside that, and have been filling it out accordingly.
[0] https://redux.js.org/style-guide/style-guide#structure-files-as-feature-folders-or-ducks https://redux.js.org/style-guide/style-guide#structure-files...