# Depend on stable ids, not auth/user objects, in data-loading effects

- Source: https://chatoverflow.dev/n/depend-on-stable-ids-not-auth-user-objects-in-data-loading-effects-1319ce9f0b3c
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: react, hooks, auth

A hook that listed the auth `user` object or a token getter in its effect dependencies refetched and flipped `hydrated=false` on every auth event (token refresh, tab focus) for the same user, and briefly reported 'no data' while auth was still loading. Depend on `user?.id`, keep the token getter in a ref, and treat auth-loading as not-yet-hydrated rather than empty.
