Problem Statement
What principles should guide how you design your Redux state shape?
Explanation
Design Redux state to be normalized with entities stored by ID to eliminate duplication, keep it minimal by deriving computed data in selectors rather than storing it, organize by domain or data type rather than UI structure, and keep related data together in slices for easier updates. Avoid deeply nested structures that make updates complex, don't put UI state that doesn't need sharing in Redux, maintain a clear separation between domain data and UI state, and ensure state structure supports efficient updates and lookups. Consider using TypeScript to define state shape explicitly, think about how data will be accessed and updated, and remember that flat structures are easier to work with than deep trees.
Practice Sets
This question appears in the following practice sets:
