Skip to main content

React Query in MUZE

The frontend uses TanStack React Query v5 for all server state management. This replaces traditional Redux/Zustand patterns for API data.

Provider setup

The provider wraps the app in App.tsx together with SessionProvider and the toast mount point.

Query patterns

Fetching data

Creating data

Updating data

Cache invalidation strategy

Query key conventions

Error handling

React Query errors are handled at the component level:

Optimistic updates

For critical UI responsiveness, some mutations use optimistic updates:

What React Query does not manage