Why did you wrap the "App" with QueryClientProvider? For TanStack Router usage, it is enough to pass "queryClient" via "context" in Router, right? I think purpose of "wrapping the App" will be making this same queryClient available in other React Components/hooks, etc.
__root.tsx is the main layout file for all routes. For default route you can do a redirect in the root route as suggested in this GitHub issue github.com/TanStack/router/discussions/304
Man, if you're trying to help people, give a second or two for viewers to read what you're doing rather than just cutting straight to the next file/scroll area. You do something that's almost entirely covered by context menus, then there's a .3 second window to pause in to verify what you did against what we've got. Trying to use this to learn, but the format/speed makes that very difficult.
man. My bad. Will try to provide more breathing space between different sections. You can look at the code for this however in the description. I attach the code link for every tutorial.
Why did you wrap the "App" with QueryClientProvider? For TanStack Router usage, it is enough to pass "queryClient" via "context" in Router, right?
I think purpose of "wrapping the App" will be making this same queryClient available in other React Components/hooks, etc.
yeah but in this example we are also using useSuspenseQuery hook inside the page components so that would require the QueryClientProvider.
please more videos about Tanstack Query + Router, and more explanation please how to integrate and where i can find resources sir ?
Sure. Will try to make an advanced one in the future. Thanks for the request
Excellent, liked
Thanks for liking the content :)
Love this. How do you get the postID into the useSuspenseQuery for the details page though??
Thanks for the appreciation. In the Post.tsx file(the post detail page), I am extracting the postId from route.useParams() in line 10.
Sir, what is a__root.tsx? What if i want a default route as /login but the default is / ?
__root.tsx is the main layout file for all routes. For default route you can do a redirect in the root route as suggested in this GitHub issue github.com/TanStack/router/discussions/304
what about loading states?
You can check out the Tanstack Router Crash Course. I displayed the loading states in this course.
Man, if you're trying to help people, give a second or two for viewers to read what you're doing rather than just cutting straight to the next file/scroll area. You do something that's almost entirely covered by context menus, then there's a .3 second window to pause in to verify what you did against what we've got. Trying to use this to learn, but the format/speed makes that very difficult.
man. My bad. Will try to provide more breathing space between different sections. You can look at the code for this however in the description. I attach the code link for every tutorial.
@@usmanabdurehman97 Don't worry. Do what you do at the pace you like. We can pause and go back to where we need. Thanks for the great work!
Thanks Richard