Reducers in Redux Toolkit must follow certain rules to correctly update the state. Common mistakes usually involve incorrect state mutations, returning the wrong value, or misusing immutability principles.
Directly mutating the state when not using Immer (outside of RTK).
Forgetting to return a new state object when using classic Redux reducers.
Returning undefined from a reducer, which breaks the Redux state update cycle.
Incorrectly handling extraReducers or mismatched action types.
Using async operations directly inside reducers instead of with thunks.
Not updating nested objects correctly (e.g., overwriting entire state unintentionally).
Accidentally shadowing or mutating action payload data.
Understanding these pitfalls helps ensure reducers behave predictably, maintain immutability, and trigger UI updates correctly.