T
TanStack14mo ago
wise-white

Tanstack Query + useRouter (Next Navigation)

Hey guys, I'm trying to redirect users to /helloworld if res.status equals 401. However, it shows the children content before redirecting, causing a layout shift.
No description
1 Reply
yelping-magenta
yelping-magenta14mo ago
Yeah your component is weird. An effect in the queryFn is very unconventional I think you meant to use a useMutation

Did you find this page helpful?