ParkEase has two React apps talking to the same API: an Android app (Expo, React Native) for drivers, owners, valets and car washers, and an admin panel (React and Vite). Both get every byte of server data through TanStack Query . Neither has Redux, Zustand or a hand-rolled fetch-into- useState anywhere.
That was a rule, not a preference. Here's why it was the right one, and how differently the two apps use the same library.
The rule: server state is not app state
The mobile rules say it in one line: TanStack Query for server state, never Redux, never Zustand. A booking, a list of parking spots, an earnings summary: these belong to the server. The app holds a cached copy , and the question is only how fresh that copy is and what to do when it's wrong.
Putting that copy in a global store means rebuilding caching, deduping, retries, refetching and invalidation yourself, badly. Leaving it in TanStack Query means one rule: read it straight from the cache, never copy it into useState .β¦