Maximum update depth exceeded when redirecting - TanStack