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.
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. :-)
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?
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
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?
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
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 🎉
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.
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...
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
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
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
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.
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. :-)
No problem my friend
tu m'a sauvé la vie avec la function async dans le client component, merci mec
Pas de problème !
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?
you can wrap your fetch on a function and call your function when you click submit
you can use server function and form action
dont run the fetch function inside the useEffect but inside an event handler onClick={getPostById}
Have you find the solution? It drives me crazy!!!
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
It is what i looking for. Great explanation, worth to subscribe 👍
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?
Hi Bro, Did you get any solution?
You saved my project🙌
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
Thanks brother
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 🎉
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.
Thank you very much for your brief explanation.
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...
Yes ! Come to my discord if you need help dub.sh/codewithg-discord
Where did you hear about avoiding useEffect? I am curious
Very helpful, thanks!
Nope thanks my friend
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
I can do it in next videos yes ! See you soon
Thanks
thank you
So the async function would work if defined inside the client component and used with usestate?
LOVE IT! GREAT CONTENT
Any tips on how we can get experimental https working locally? I am using NextJS for a frontend to a Laravel API project.
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
I have the same error did u fixed it?
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?
Yes you are right, NextJS app folder does not support getServerside props it was supported in pages directory.
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
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
@@codewithguillaume is there a way to send you the api call, its a really simple code
This method returns hydration error when there is loading.js. Do you have any idea on how to fix it?
You can remove the warning by putting an attribute suppressedHydrationWarning to true inside html or body element
But you cannot deploy a next app with localhost url ?
how can i use Axios with it?
Hello sir, in the new version of next js 14, are the getstaticprops functions still used?
You will not need to use the getStaticProps hook with Next.js 14
Wonderfull