State Management · Senior · Question 46 of 75
A legacy app keeps API responses in Redux slices with hand-written loading flags. What's a pragmatic migration?
- ✓Correct answer: Move server data to RTK Query (or TanStack Query) endpoint by endpoint, keeping slices for client state
- 2Rewrite everything to Zustand in one release
- 3Move all state into Context
Explanation
Incremental migration lowers risk: each endpoint replaces a thunk, its slice fields and loading flags. RTK Query lives in the same store, so the two approaches coexist during the transition.