Tanstack Query + Router Integration in 8 minutes

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ต.ค. 2024

ความคิดเห็น • 16

  • @sachingaikwad123
    @sachingaikwad123 หลายเดือนก่อน +1

    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.

    • @usmanabdurehman97
      @usmanabdurehman97  หลายเดือนก่อน

      yeah but in this example we are also using useSuspenseQuery hook inside the page components so that would require the QueryClientProvider.

  • @0xy23
    @0xy23 2 หลายเดือนก่อน +1

    please more videos about Tanstack Query + Router, and more explanation please how to integrate and where i can find resources sir ?

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      Sure. Will try to make an advanced one in the future. Thanks for the request

  • @meowmix0008
    @meowmix0008 5 หลายเดือนก่อน

    Excellent, liked

    • @usmanabdurehman97
      @usmanabdurehman97  5 หลายเดือนก่อน

      Thanks for liking the content :)

  • @sami616
    @sami616 3 หลายเดือนก่อน

    Love this. How do you get the postID into the useSuspenseQuery for the details page though??

    • @usmanabdurehman97
      @usmanabdurehman97  3 หลายเดือนก่อน

      Thanks for the appreciation. In the Post.tsx file(the post detail page), I am extracting the postId from route.useParams() in line 10.

  • @0xy23
    @0xy23 2 หลายเดือนก่อน +1

    Sir, what is a__root.tsx? What if i want a default route as /login but the default is / ?

    • @usmanabdurehman97
      @usmanabdurehman97  2 หลายเดือนก่อน

      __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

  • @AntônioLemos-f2l
    @AntônioLemos-f2l หลายเดือนก่อน +1

    what about loading states?

    • @usmanabdurehman97
      @usmanabdurehman97  หลายเดือนก่อน

      You can check out the Tanstack Router Crash Course. I displayed the loading states in this course.

  • @colegonzales6535
    @colegonzales6535 4 หลายเดือนก่อน

    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.

    • @usmanabdurehman97
      @usmanabdurehman97  4 หลายเดือนก่อน

      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.

    • @richardhaughton9633
      @richardhaughton9633 3 หลายเดือนก่อน

      @@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!

    • @usmanabdurehman97
      @usmanabdurehman97  3 หลายเดือนก่อน

      Thanks Richard