Summary
We used Redux in this app, and that shaped the folder structure we use. Although using Redux requires some boilerplate code, it helps break up our codebase in a reasonable way and removes direct dependencies between containers or screens. Redux is definitely a great addition when we need to maintain a shared state between screens, so we will be using it further throughout the rest of this book. In more complex apps, we would need to build more reducers and possibly separate them by domain and use Redux combineReducers
. Moreover, we would need to add more actions and create separate files for each group of actions. For example, we would need actions for login, logout, and register, which we could put together in a folder named src/actions/user.js
. Then, we should move our image-related actions (currently in index.js
) to src/actions/images.js
, so we can modify src/actions/index.js
to use it as a combinator for the user and images actions in case we want to have the ability to import...