As the app will grow, it will surely need some state management system, so it's good to start with one if we know we will need it, because it will be difficult to introduce it later.
The choice is Redux, maybe too boiler-platy for some, but battle tested.
The structure is to have reducer.js and actions.js in each top level module (the directories under src such as categories).
A root reducer, currently placed in index.js where the store is also created, will compose them.
Each top-level module exports the reducer and actions from its index.js file.
As the app will grow, it will surely need some state management system, so it's good to start with one if we know we will need it, because it will be difficult to introduce it later.
The choice is Redux, maybe too boiler-platy for some, but battle tested.
The structure is to have
reducer.js
andactions.js
in each top level module (the directories undersrc
such ascategories
).A root reducer, currently placed in
index.js
where the store is also created, will compose them.Each top-level module exports the reducer and actions from its
index.js
file.