Fetching with Next.js 14 - Course part 15

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

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

  • @blackdev417
    @blackdev417 29 วันที่ผ่านมา

    Thanks for explaining these concepts without all of the fluff, just getting straight to the relevant information. I am learning a lot through this Next.js series. Thank you so much.

  • @PetriikVx
    @PetriikVx 10 หลายเดือนก่อน +3

    Hi Guillaume, your course is excellent. Although I don´t have the time to go through the entire course, I always come back and every time I find the answer to my questions. :-)

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

    tu m'a sauvé la vie avec la function async dans le client component, merci mec

  • @shawn.builds
    @shawn.builds 10 หลายเดือนก่อน +10

    Regarding "Fetch on Client Component" - what if we don't want to fetch the data immediately, e.g. only want to fetch the data after the user clicks Submit?

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

      you can wrap your fetch on a function and call your function when you click submit

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

      you can use server function and form action

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

      dont run the fetch function inside the useEffect but inside an event handler onClick={getPostById}

    • @Ja-rz9fq
      @Ja-rz9fq 8 หลายเดือนก่อน

      Have you find the solution? It drives me crazy!!!

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

    wow. you simply said it all. some youtubers just bit around the bush. I was wandering why the old method did not work. is saw them use localhost but they never said why

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

    It is what i looking for. Great explanation, worth to subscribe 👍

  • @Jack-ss4re
    @Jack-ss4re 10 หลายเดือนก่อน +8

    In nextjs 14 app router, what if i need to use client-side hooks in my page AND fetch data like we used to do with "getServerSideProps"? theres a way to do that? since i insert 'use client' i can no longer fetch data statically or from serverside right?

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

      Hi Bro, Did you get any solution?

  • @TonnyMwasumbi-lg7hz
    @TonnyMwasumbi-lg7hz 2 หลายเดือนก่อน

    You saved my project🙌

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

    Good tutorial, man. You saved my days of figuring out to fetch data from dynamic pages :)) . Thing is I had to modify my code based from your example in adding useParams imported from next/navigation. I adapted it to my code since I'm using Prisma for database, and the code is slightly different from yours. Thanks :) I subbed to you. (sry not my developer account, but thanks hehe) :D

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

    Great video but I have a question. Will server components be always SSR? Or under which conditions a server component will still be rendered as a client component, thanks 🎉

    • @ShibuDhara-h3w
      @ShibuDhara-h3w 7 หลายเดือนก่อน

      In nextjs by default components are server SSR, but if your components is interactive, needs real time interaction then you have to convert it to client component forcefully by using "use client" directive.

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

    Thank you very much for your brief explanation.

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

    Excellent tutorial, thank you. I have a follow-up question, is it possible to use Server Actions for this purpose of fetching data in a Client Component to avoid useEffect? I keep hearing that useEffect should be avoided as much as possible, but haven't found a way to use Server Actions instead in most cases...

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

      Yes ! Come to my discord if you need help dub.sh/codewithg-discord

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

      Where did you hear about avoiding useEffect? I am curious

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

    Very helpful, thanks!

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

    Hey Great content, can you also create a video explaining fetching data from database like postgres or mysql (using sequalize) with next js 14
    ... that would be great... I am getting error while doing this even though I have installed packages pg and sequelize

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

      I can do it in next videos yes ! See you soon

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

    Thanks

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

    thank you

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

    So the async function would work if defined inside the client component and used with usestate?

  • @capricorn.engineering
    @capricorn.engineering ปีที่แล้ว

    LOVE IT! GREAT CONTENT

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

    Any tips on how we can get experimental https working locally? I am using NextJS for a frontend to a Laravel API project.

  • @ys1197
    @ys1197 10 หลายเดือนก่อน +2

    Hello, I need help. I am trying to host in vercel but it gives me an error. Doing it this way the data will come undefined. I guess that is because the localhost:3000 on Vercel. any ways to fix this? thx

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

      I have the same error did u fixed it?

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

    am i missing something, have they not invented getServerside props and so on to not have to do this? are we going back in nextjs14?

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

      Yes you are right, NextJS app folder does not support getServerside props it was supported in pages directory.

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

    can you help me please dude? you are the only one that gets close to my problem but i still cant figure it out. in my project i have a client side component for a page that fetches to my api endpoint which queries the postgres database i have on vercel. long story short, in development if i insert a new row in the database it will take into consideration but in production it wont update even if i refresh the page and it would only show the new row if i commit again the project. is there a way to get in contact with you? please man, i will literally tell about your channel to anyone i know learning next js if you can help me fix this problem that drives me crazy. i can show you the code, aand whatever you need

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

      Hey mate it looks like it’s a problem from SSR rendering try revalidate your page OR it’s a problem from your API call ! Best

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

      @@codewithguillaume is there a way to send you the api call, its a really simple code

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

    This method returns hydration error when there is loading.js. Do you have any idea on how to fix it?

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

      You can remove the warning by putting an attribute suppressedHydrationWarning to true inside html or body element

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

    But you cannot deploy a next app with localhost url ?

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

    how can i use Axios with it?

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

    Hello sir, in the new version of next js 14, are the getstaticprops functions still used?

    • @tm-nm5hk
      @tm-nm5hk 10 หลายเดือนก่อน

      You will not need to use the getStaticProps hook with Next.js 14

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

    Wonderfull