React Query with Next.js App Router

Поделиться
HTML-код
  • Опубликовано: 6 сен 2024

Комментарии • 30

  • @Supabase
    @Supabase  8 месяцев назад +3

    Thanks for watching! For advanced server rendering please watch the second video: ruclips.net/video/AnRshBKUApg/видео.html

  • @nikhilpsathyanathan
    @nikhilpsathyanathan 8 месяцев назад +6

    Using T3 stack with supabase & drizzle, It's nice

  • @oamarkanji3153
    @oamarkanji3153 8 месяцев назад +3

    This and the next video is what I have been looking for

    • @Supabase
      @Supabase  8 месяцев назад +1

      Nice, we've just released the SSR video: ruclips.net/video/AnRshBKUApg/видео.html \o/ Hope it's useful for you :)

  • @filipesommer8253
    @filipesommer8253 7 месяцев назад +5

    Cool video, thanks! However I thought nextjs has builtin caching mechanisms itself. Why would you need tanstack query if you can specify what you want to cache/revalidate just with nextjs?

    • @vash6249
      @vash6249 7 месяцев назад +2

      This is a thing that I was wondering and I'd like to understand as well

    • @user-iu2mz2mq6n
      @user-iu2mz2mq6n 7 месяцев назад +2

      Isn't it because we can benefit from React Query's data prefetching, query state hydration/dehydration, compatibility with streaming SSR, etc.?

    • @CUBKITS
      @CUBKITS 6 месяцев назад +4

      I thought so as well, but tanstack query abstracts away a ton of the boilerplate required to make requests, manage loading state, errors, re-fetching, and stuff like that. I tried using next's built-in fetch API for my project, but it still just required a lot of overhead to track request state and stuff.

    • @kosidinna_
      @kosidinna_ 5 месяцев назад +1

      tanstack query is used on the client components.

    • @CUBKITS
      @CUBKITS 5 месяцев назад +2

      @@kosidinna_ It's used on client components, but you can also pre-fetch the data on server components with it, so that your query client pulls from pre-fetched server data. Pretty cool!

  • @davidkhierl696
    @davidkhierl696 7 месяцев назад +2

    you can press F2 key to rename the function/variable name :D

  • @user-vu9dl3vn7l
    @user-vu9dl3vn7l 3 месяца назад

    It's a great video. Thanks a lot! ❤

  • @derekjwilliams
    @derekjwilliams 5 месяцев назад

    Thanks so much for this, I have it working for my project, though I have not fully grokked everything. i was wondering if it is possible to redirect from the countries/[id] page if the user is not authenticated, have not been able to get this to work, yet.

  • @deanelie7775
    @deanelie7775 8 месяцев назад +7

    Isn’t that making your entire project as a CSR instead of SSR at 4:45? If so, you will loose all of the benefit using Next.js

    • @timurbas5713
      @timurbas5713 8 месяцев назад

      I'm wondering the same thing

    • @Supabase
      @Supabase  8 месяцев назад +2

      I don't think so, see nextjs.org/docs/app/building-your-application/rendering/client-components#how-are-client-components-rendered

    • @Dhanushsaji
      @Dhanushsaji 7 месяцев назад +7

      No..
      If we want to use the SSR page inside CSR this is the best way(the only way I guess)
      If you import an SSR page into a CSR page by default it will convert into CSR.
      But you can tackle this issue by just passing the SSR page as a child to the CSR page.

    • @CUBKITS
      @CUBKITS 6 месяцев назад +1

      A few things:
      1. You can nest SSR components inside CSR components, it just leaves a slot for the SSR component.
      2. "All the benefit of using Next.js" does not end at SSR. There is so much more to it, like a solid page router, server actions, and a ton of other built-in goodies.
      3. ALSO, 'use client' doesn't actually remove the benefits of SSR. When a client is marked with 'user client', the static page is still generated on the server, as much as it can, but is then hydrated on the client.

  • @derekjwilliams
    @derekjwilliams 5 месяцев назад

    Brilliant as always!

  • @dear_up
    @dear_up 2 месяца назад +1

    you wrapped everything with client component and now whole webside is client side rendered pages, but i need some ssr pages

  • @user-eq5ii2tq6g
    @user-eq5ii2tq6g 8 месяцев назад +1

    Release that next vid!

    • @thorwebdev
      @thorwebdev 8 месяцев назад +2

      Just finishing it up now. Should be out tomorrow 👍

    • @Supabase
      @Supabase  8 месяцев назад

      SSR video out now: ruclips.net/video/AnRshBKUApg/видео.html \o/ Hope it's useful for you :)

  • @user-de8ev2bn2d
    @user-de8ev2bn2d 8 месяцев назад +2

    2X watch

  • @rooba_web3
    @rooba_web3 7 месяцев назад +5

    Just a small tip, or critique for the future. You cadence is very annoying most of the time. Try to be more engaging instead of speaking like you don't even know what's going on, even if I know you do. Awesome video tho, helped me a lot to setup the reactQuery in NextJS

  • @kamrant8915
    @kamrant8915 3 месяца назад +2

    Bad explanation!!!

  • @officiallydheeraj
    @officiallydheeraj 3 месяца назад +1

    Supabase sucks