Hi there, I am using a query in my beforeload function in my router. It's a function that fetches the user session, but I have an issue, that it seems that whenever I navigate anywhere on my app, the function gets called every time, sometimes multiple times:
beforeLoad: async ({ context }) => {
const user = await context.queryClient.fetchQuery({
queryKey: ["user"],
queryFn: ({ signal }) => getUser({ signal }),
});
return { user };
}
This is my implementation, do I need to add more properties? I sent a screenshot of my terminal it just shows a bunch of calls from me just hovering over a link few times