T
TanStack12mo ago
intense-chocolate

Start + Query = context problem

I have similar problem on my machine like here: https://stackblitz.com/github/tanstack/router/tree/main/examples/react/start-basic-react-query?embed=1&theme=light&preset=node&file=src/main.tsx After loading, go to Post page, you will see error. Click try again and posts will show. Why is that?
StackBlitz
Router Start Basic React Query Example - StackBlitz
Run official live example code for Router Start Basic React Query, created by Tanstack on StackBlitz
1 Reply
intense-chocolate
intense-chocolateOP12mo ago
2nd issue with Query is: go to __root.tsx, add
beforeLoad: ({context}) => ({
...context,
hello: 1
}),
beforeLoad: ({context}) => ({
...context,
hello: 1
}),
Go to homepage, refresh. Next go to Post, error: context.queryClient.ensureQueryData is not a function However, if you refresh being on this page, error disappears, shows only on SPA navigation. Facing on my little project too

Did you find this page helpful?