Next.js 9.3+ Data Fetching Explained: getServerSideProps(), getStaticProps(), and getStaticPaths()

  Рет қаралды 60,857

Ado Kukic

Ado Kukic

Күн бұрын

Пікірлер: 127
@Karlponken
@Karlponken 4 жыл бұрын
Great explanation! Had a hard time understanding the difference of these 3 from reading the docs, this helped alot! Thanks!
@lalitvavdara5841
@lalitvavdara5841 3 жыл бұрын
probably the best explaination for data fetching capabilities of Nextjs...great work
@anonysmooth648
@anonysmooth648 3 жыл бұрын
best explanation with real example, this is what I need in every tutorial
@kulrajchavda9538
@kulrajchavda9538 3 жыл бұрын
Best explanation available on the internet!!
@aidanwalker3058
@aidanwalker3058 3 жыл бұрын
I struggled to understand between getStaticProps and getServerSideProps, watched a few videos but still didn't get it until yours. Greatly explained thanks 🙂
@ado
@ado 3 жыл бұрын
Great to hear!
@maskman4821
@maskman4821 4 жыл бұрын
Thank you for the great explanations/demonstration/illustrations of data fetching, I am very glad to understand the differences between getServideSideProps and getStaticProps, the mongodb example is awesome for us to understand the differences between these two functions. Thank you so much !!!
@piyshkmr
@piyshkmr 2 жыл бұрын
Great Explanation. I really wanted a detailed video like this
@rudeadyet1992
@rudeadyet1992 4 жыл бұрын
This really cleared out some of the confusions. Thanks for the explanation. Appreciate it.
@mr.rajeshmekala
@mr.rajeshmekala 3 жыл бұрын
You nailed it Ado. Clear explanation with examples. Please Keep making videos.
@ado
@ado 3 жыл бұрын
Thank you :)
@farstep4011
@farstep4011 3 жыл бұрын
This video is short and complete. Thanks for sharing!!
@joebao2536
@joebao2536 2 жыл бұрын
very straight and practical explanation ! Awesome
@computecastle6099
@computecastle6099 3 жыл бұрын
Man, you are awesome. Was trying to understand these three data fetching methods for so long. Thanks!
@justinlu5730
@justinlu5730 3 жыл бұрын
the best explanation in all youtube, thanks ado, it helped me a lot !
@MeganGrantCurlyGirl
@MeganGrantCurlyGirl 4 жыл бұрын
Love it. Keep up the good work!
@sabeekaqureshi4259
@sabeekaqureshi4259 3 жыл бұрын
The best explanation I have seen on this, thanks!
@emilioortega9487
@emilioortega9487 2 жыл бұрын
your explanation was amazing ! please keep posting these videos :) great work
@evanlittle114
@evanlittle114 3 жыл бұрын
Thank you, your explanation and demo was awesome and fully clarified how these concepts work
@joelmuluh1
@joelmuluh1 2 жыл бұрын
Very excellent explanation!
@saalimkhan4133
@saalimkhan4133 3 жыл бұрын
Beautifully explained
@fyardlest1
@fyardlest1 3 жыл бұрын
Really helpful thank you! By the way, next time set the sound properly cause I have to push the volume up to hear, lol. We need more next js tuts like this one.
@anthonysim563
@anthonysim563 2 жыл бұрын
Thank you, this was an excellent explanation!
@shailander13
@shailander13 3 жыл бұрын
I was running on local environment where site builds on every refresh so got really confused between the getStaticProps and getServerSideProps. Now it’s clear thanks to this video. Also the explanation of getStaticPaths was very good with easy to understand examples. Great work👏🏻👏🏻
@iShubhamPanchal
@iShubhamPanchal 3 жыл бұрын
Straightforward, Hands-on, Great explanation. Thanks buddy and keep going and I just subscribed .
@blakefre
@blakefre 4 жыл бұрын
Great great explanations. Thank you so much for this, very grateful
@ado
@ado 4 жыл бұрын
Glad it was helpful!
@MahmoudALSrouji
@MahmoudALSrouji 4 жыл бұрын
Greatly explained. Thank you!
@devinflora
@devinflora 2 жыл бұрын
Wonderful explanation! Thank you so much for making this video!
@PawanKumar-tu6ti
@PawanKumar-tu6ti 2 жыл бұрын
Thank you for so useful video, really appreciate that.
@wfth1696
@wfth1696 3 жыл бұрын
Great explanation. It really helped me grasp it properly. Thank you!
@jacobcambell
@jacobcambell 3 жыл бұрын
Very well explained cleared my confusion thanks man 👍
@cutipets8706
@cutipets8706 2 жыл бұрын
Great video, great explanation Thank you so much
@mohitsojitra3965
@mohitsojitra3965 4 жыл бұрын
Very well explained all the concepts.
@lefterisk1872
@lefterisk1872 2 жыл бұрын
Man....your are awesome....for real....!!
@hiteshagja24
@hiteshagja24 4 жыл бұрын
Very well explained.
@ado
@ado 4 жыл бұрын
Glad you liked it
@carlosbenavides670
@carlosbenavides670 3 жыл бұрын
Thanks for the video. Pretty useful.
@ThePeerroo
@ThePeerroo 3 жыл бұрын
Hvala Ado olaksao si mi zivot :D
@ankitdalasaniya2463
@ankitdalasaniya2463 3 жыл бұрын
You save my day... thanks brother...👍👍
@skverskk
@skverskk 3 жыл бұрын
Well done and very informative
@ОлегПузанкін
@ОлегПузанкін 4 жыл бұрын
Thank you for such great explanation
@ado
@ado 4 жыл бұрын
Glad it was helpful!
@tech3425
@tech3425 2 жыл бұрын
Great Explanation
@darksurvey2347
@darksurvey2347 2 жыл бұрын
really helpful.😊😊😊
@yasamansifarianasl7030
@yasamansifarianasl7030 4 жыл бұрын
Thank you very much, it's really helpful for me! Please create more next.js videos
@ado
@ado 4 жыл бұрын
More to come! Anything specific you'd like to see?
@rojitblaze13
@rojitblaze13 4 жыл бұрын
Was really confused about getStaticProps and getServerSideProps as it was doing the same thing. This really helped. Is it mentioned some where in the docs?
@abasthurabli7630
@abasthurabli7630 4 жыл бұрын
Thanks for the video. I learned a lot of things. 👍
@GamerSolitO
@GamerSolitO 3 жыл бұрын
very usefull tutorial! This helped me more than the explanation of my college professor. Thanks man, you should upload more videos like this! New subscriber. you got some potential
@garrysandhu4197
@garrysandhu4197 3 жыл бұрын
Awesomeeeee Explanation.
@ganapathipranesh8506
@ganapathipranesh8506 4 жыл бұрын
Much neat and precise! thanks 🙏🏼
@josephuzuegbu7431
@josephuzuegbu7431 2 жыл бұрын
I love this video. Thanks
@isaacemmanuel
@isaacemmanuel 3 жыл бұрын
Very well explained, Thanks Ado
@snpr9603
@snpr9603 4 жыл бұрын
Thanks! Very good explanation!
@EVA_Hamza
@EVA_Hamza 3 жыл бұрын
Awesome explanation, thank you
@stevejohann5101
@stevejohann5101 3 жыл бұрын
Nicely done - thank you for your time!
@ado
@ado 3 жыл бұрын
My pleasure!
@nikosspiropoulos8417
@nikosspiropoulos8417 3 жыл бұрын
very good explanation thank you!!
@mirzadvarupa5652
@mirzadvarupa5652 3 жыл бұрын
Hvala ti Ado! :)
@babaganaabba785
@babaganaabba785 3 жыл бұрын
Thanks so much. This was really helpful
@FranciscoHernandez-vh6bv
@FranciscoHernandez-vh6bv 2 жыл бұрын
Honestly great video
@codingwithlucy
@codingwithlucy 2 жыл бұрын
Really nicely broken down, thank you so much :)
@pavlo-vasylkivskyi
@pavlo-vasylkivskyi 4 жыл бұрын
Thanks! Wery clean explanation 🤗
@zanbri
@zanbri 3 жыл бұрын
One suggestion: the audio was quite low -- it would be helpful to normalize it to a higher volume. Otherwise, a great video - thanks!
@leanprogrammer
@leanprogrammer 4 жыл бұрын
Great stuff! More nextjs videos 👍
@javascriptprisoner900
@javascriptprisoner900 4 жыл бұрын
Wow! This video was really helpful for me. Thank you!
@nahida4444
@nahida4444 3 жыл бұрын
one question about the getStaticProps and unstable_revalidate. You mentioned that it gonna update every second or every 10 mins (depending on what you set). Does that mean it can work as setInterval? I am trying to do make a cryptocurrency ticker, where I want the currencies will update every 5 seconds, so I am making api calls every 5 seconds using useEffect and setInterval. I wonder if I can make the function using getStaticProps
@anphearab8250
@anphearab8250 4 жыл бұрын
Great video ! Keep it up !
@ado
@ado 4 жыл бұрын
Thanks!
@DanZ-fq2qs
@DanZ-fq2qs 3 жыл бұрын
Great explanation mate, is the demo project open source ?
@PuntielRealty
@PuntielRealty 2 жыл бұрын
Thanks bro very clear and understandable. How about handling form submit and storing the data?
@neerajsinghtangariya2587
@neerajsinghtangariya2587 3 жыл бұрын
I think in new version nextjs provided revalidate instead of unstable_revalidate. Right ?
@shailander13
@shailander13 3 жыл бұрын
right
@adimardev1587
@adimardev1587 3 жыл бұрын
thank you it helps a lot!
@cutipets8706
@cutipets8706 2 жыл бұрын
I have a question what if we set the callback to true and we typed in an id in the URL that doesn't exist in the database how can we handle this situation?
@mroobert
@mroobert 4 жыл бұрын
Great content! Liked & Subscribed
@ado
@ado 3 жыл бұрын
Awesome, thank you! Much appreciated!
@markusbuchanan6130
@markusbuchanan6130 2 жыл бұрын
Great Video! Just had a question : Is there any benefit to making fallback false? It looks like its just going to error out any new pages for new data that will be added in the future based on the video to me.
@dawid_dahl
@dawid_dahl 3 жыл бұрын
Great video. Subscribed!
@testrandom1852
@testrandom1852 2 жыл бұрын
Thank You!
@abdulmoeez13
@abdulmoeez13 3 жыл бұрын
Keep It Up ❤️
@sabassegovia3915
@sabassegovia3915 2 жыл бұрын
Awesome video!
@djelasrca8091
@djelasrca8091 2 жыл бұрын
can you put link to the github repository? I would like to take a look on your function for data fetching
@dushyantkumar4428
@dushyantkumar4428 4 жыл бұрын
Nice Video. Can you add more info on incremental static regeneration?
@ado
@ado 4 жыл бұрын
Hey Dushyant, yes I will create a video on it next week!
@ado
@ado 4 жыл бұрын
Made it: kzbin.info/www/bejne/f3vOhaOIbNiGras :)
@igotbit9454
@igotbit9454 3 жыл бұрын
Very useful. Subbed
@kirillpavlovskii8342
@kirillpavlovskii8342 3 жыл бұрын
does node js express server runs under the hood to constantly fetch data and serve it in getservsideprops method?
@DanFlakes
@DanFlakes 3 жыл бұрын
Great tutorial!
@hiberniankingy
@hiberniankingy 3 жыл бұрын
so correct me if I'm wrong here but do these fetch methods mean you don't have to rely on useEffect?
@igorr4682
@igorr4682 3 жыл бұрын
Nice gb music 🎺
@mohammedhijas106
@mohammedhijas106 3 жыл бұрын
Nice one !
@davidsonzed
@davidsonzed 3 жыл бұрын
This is really awesome, can you also make a video about hooks
@rafahdez2772
@rafahdez2772 3 жыл бұрын
is there any way the I can pass information from getStaticProps to getStaticPaths so the app doesn't have to do 2 request getting the same information??
@drworm1110100
@drworm1110100 3 жыл бұрын
Thanks!!!
@pannihto7588
@pannihto7588 4 жыл бұрын
Quality content. Just gotta work on editing a little bit :)
@ado
@ado 4 жыл бұрын
Thanks! yeah it's a work in progress :)
@ivaylopetrov9956
@ivaylopetrov9956 3 жыл бұрын
Good job man
@hoodieson2008
@hoodieson2008 3 жыл бұрын
Nice! Actually took something away from the video!!
@user-ce4ct8ws8r
@user-ce4ct8ws8r 2 жыл бұрын
Hii there, I have a question .. What if the data fetching takes time ? would gSSP hold the page rendering or will empty page will appear?
@Rusakin
@Rusakin 3 жыл бұрын
how to revalidate in getserversideprops?
@FitnessChaos
@FitnessChaos 3 жыл бұрын
Why do you compress lines of code? How can a viewer understand the context of the code if you got lines compressed / hiding.
@berlino5563
@berlino5563 4 жыл бұрын
Hi Ado, cool your channel :) i have a question: i'm working a fullstack app with Next js and a headless cms as backend restfull api. I need to handle logout user with jwt in cookie httponly (server side - not access in client side). what approach do you recommend about to implement logout user? what is the simplest and fast solution?
@ado
@ado 4 жыл бұрын
Hi Berlino, that's a great question. For all things authentication and authorization I usually prefer to defer things to Auth0. They have a really good Next.js library (github.com/auth0/nextjs-auth0). But if you're rolling your own solution, I would just create an API route in Next.js to handle that logout call. In Next.js API routes you have full access to the request object so can destroy the cookie there thereby logging the user out. Let me know if this helps!
@aseeldweedar180
@aseeldweedar180 2 жыл бұрын
thank you
@muhammadalbab2678
@muhammadalbab2678 3 жыл бұрын
i'm a bit confused, then what is the difference between using only the useEffect hooks to fetch data and the getServerSideProps() ? can someone pls explain
@romimaximus
@romimaximus 3 жыл бұрын
Ok, so if i use the "getStaticProps " and "getStaticPaths", and build the app, and deploy it, ... and every time , something changes in the database, i gonna have to rebuild the app and deploy again ?...this kind of confusing.. 🤔
@mitchellbenjamin3071
@mitchellbenjamin3071 2 жыл бұрын
thank u
@online-notary-us
@online-notary-us 2 жыл бұрын
Where is the code to help us follow along?
@moosegoose1282
@moosegoose1282 3 жыл бұрын
uhh how is data being passed from props to ur component? u didn't show that at all
@malikbrahimi7504
@malikbrahimi7504 4 жыл бұрын
Can you do a tutorial on handling concurrent clients? For example if I'm on a page /item/:id where id=1 and another user deletes that resource from the DB, what should happen to me as a user while I'm on that stale page? What if two users are mutating an object at the same time?
@ado
@ado 4 жыл бұрын
Hey Malik - that’s not a bad idea. I’ll create a video on it next week. :D
@gjahnavi1688
@gjahnavi1688 3 жыл бұрын
@@ado hey,can you explain me How to import that "fetchGraphQLQuery" in nextjs
@Psychobellic
@Psychobellic 3 жыл бұрын
I'm going crazy with this lol... NextJS was so easy until now xD how can I get a query from the user and then run this query fetch in server-side? My API key cannot be exposed =(
@alooooooola
@alooooooola 4 жыл бұрын
so if facebook has 1 billion post so their backend has to query for 1 billion post id then frontend has to call an api to get that 1 billion paths. It sounds wrong for me
@ado
@ado 4 жыл бұрын
If they wanted to pre-render all of that content, then yes, but they're unlikely to want to pre-render all of it ahead of time. With Incremental SSR though, those pages can be generated when they are requested and still served statically.
Client-Side VS Server-Side Rendering - Data Fetching with Next.js
13:20
freeCodeCamp Talks
Рет қаралды 184 М.
Next.js Tutorial - 17 - Static Generation with getStaticProps
8:33
$1 vs $500,000 Plane Ticket!
12:20
MrBeast
Рет қаралды 122 МЛН
UFC 287 : Перейра VS Адесанья 2
6:02
Setanta Sports UFC
Рет қаралды 486 М.
NextJS Incremental Static Generation and Regeneration Explained
18:03
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 239 М.
Next.js App Router: Routing, Data Fetching, Caching
14:32
Vercel
Рет қаралды 341 М.
Next.js - getStaticProps vs. getServerSideProps
12:46
Anson the Developer
Рет қаралды 10 М.
Should You Stop Using React
8:13
Ben Awad
Рет қаралды 152 М.
Next.js No longer use SSR/SSG functions
12:49
CoderOne
Рет қаралды 72 М.
Next.js Tutorial #10 - Fetching Data (getStaticProps)
8:01
Net Ninja
Рет қаралды 184 М.
Все виды Server-side рендеринга в NextJS: SSR, CSR, SSG, ISR
14:39
Веб-разработка - DevMagazine
Рет қаралды 22 М.
What are Message Queues? | BullMQ Queues NodeJS
44:12
Piyush Garg
Рет қаралды 42 М.
This is the Only Right Way to Write React clean-code - SOLID
18:23
$1 vs $500,000 Plane Ticket!
12:20
MrBeast
Рет қаралды 122 МЛН