Next.js Tutorial - 17 - Static Generation with getStaticProps

  Рет қаралды 88,299

Codevolution

Codevolution

Күн бұрын

Пікірлер: 45
@Codevolution
@Codevolution 3 жыл бұрын
Give Taskade a try - www.taskade.com/ Use Coupon Code 'CODEVOLUTION' for 50% OFF lifetime discount applied to any upgraded subscription 1st 100 viewers to contact via www.taskade.com/contact get the upgrade for free!
@nikhilraj4098
@nikhilraj4098 Жыл бұрын
I love how you take things slowly, it really helps. I'm watching this despite Next 13 stable already being out. Thanks for such good videos, I hope you keep making them this way and grow stronger.
@mdtasib4058
@mdtasib4058 3 жыл бұрын
Hey! I'm from Bangladesh. I really love this channel.
@md.sharifulhoque8689
@md.sharifulhoque8689 3 жыл бұрын
me 2
@Jean-yk9eo
@Jean-yk9eo 3 жыл бұрын
Main, Thank you a lot. I was a bit confused by this and the last three videos helped me to understand what is going on,
@sergekamga4512
@sergekamga4512 Жыл бұрын
This dude is an awesome 😢teacher
@shahreazneeloy2119
@shahreazneeloy2119 2 жыл бұрын
Great work man. Respect.
@haha7836hahah
@haha7836hahah 2 жыл бұрын
What if i have a database query in getStaticProps method and the data in database updates after building. Will the data in props update or will It still show the old data
@NIKHILYADAV-xm9ql
@NIKHILYADAV-xm9ql 3 жыл бұрын
Could we don't use useEffect or redux to fetch data and please elaborate basic difference between static Prop and side effect data fetching thanks
@learnearn8721
@learnearn8721 3 жыл бұрын
My guru vishwas thanks a lot
@godwinikechukwu3129
@godwinikechukwu3129 2 жыл бұрын
Great tutorial..
@parasbuda9174
@parasbuda9174 3 жыл бұрын
sir as you have mentioned that we can use getStaticProp for the product listing page but getStaticProp fetch the data at build time so when the product list is added with another product.will that previous build will work or we have to make a new build for that?
@bhargavaprabureddym9693
@bhargavaprabureddym9693 3 жыл бұрын
Inside the getStaticProp method, we are fetching some data that can be updated anytime, We are instructing the getStaticProp method to fetch data from the external server, and pass it as props to the default function. The data can be anything like that, it can return 3 products or even 100 products, it depends on the data available in the external server. For that, we don't need to build it every time, if we do so there is no sense in using Next JS.
@user-xf5wx7uq2z
@user-xf5wx7uq2z 3 жыл бұрын
@@bhargavaprabureddym9693 Since JSON is already loaded during build time, shall we not need to rebuild it if some more data is added to the API endpoint?
@abinashmandal6202
@abinashmandal6202 Жыл бұрын
If we have used getStaticProps, We have to rebuild every time data changes to get the updated data
@pravinchukkala545
@pravinchukkala545 Жыл бұрын
I got the answer, just search in google for how getStaticProps works you will get the answer
@vampirekabir
@vampirekabir 2 жыл бұрын
finally i understand this
@mdabuhanif357
@mdabuhanif357 Жыл бұрын
Thank you for your fantastic playlist. Have we missed Static Generation without data video or something else? @Codevolution
@Ibrahim__123
@Ibrahim__123 Жыл бұрын
During the video, he mentioned that, that is the default way Next js works ..so if we are not fetching any external data...the page statically pre-render for better performance and SEO
@PM-rs4te
@PM-rs4te Жыл бұрын
So, when you have data that is seldom changes, you can go this route but if its constantly changing, use useEffect? Did I understand this correctly??
@RubberDuckCoding
@RubberDuckCoding 3 жыл бұрын
VERY NICE!
@orincywhytedesigns
@orincywhytedesigns 2 жыл бұрын
This was so cool …
@sunveerahman1974
@sunveerahman1974 3 жыл бұрын
Sir , Please Show , How I can Integrate Material Ui with Next js
@ryanspeciale4451
@ryanspeciale4451 3 жыл бұрын
What do you mean
@ryanspeciale4451
@ryanspeciale4451 3 жыл бұрын
Install material ui and import the components....
@robertphillips124714
@robertphillips124714 2 жыл бұрын
Would this really be used for product pages in the real world? When my product database is updated, I'd need to rebuild and redeploy, right?
@manasjoshi7037
@manasjoshi7037 2 жыл бұрын
same doubt..do you find any answer?
@techupdate03
@techupdate03 Жыл бұрын
I have a doubt. That async function is always return promise. To hande that we generally use .then . catch, then here how we get the props directly without handle the promise. Can anyone explain.
@aaqibrasool6341
@aaqibrasool6341 3 жыл бұрын
I got just one issue, my CSS is not getting applied to statically generated pages at the first load in the network tab.
@rhul0017
@rhul0017 3 жыл бұрын
whats build time in production means? u mention it around 3:00
@abdulbasir8740
@abdulbasir8740 3 жыл бұрын
For production builds, a page will be pre-rendered once when we run the build command. In development mode, the page is pre-rendered for every request you make.
@modernNeanderthal800
@modernNeanderthal800 11 ай бұрын
Now in 2024 we should be pushing for next 13 / 14, but if you are learning next 12 for a job understand that "getStaticProps" wants you to return an object. Try this return {props: { users: users } } or return {props: {data: users}}
@mohantee
@mohantee 2 жыл бұрын
So, the user names would not have shown in the page source if we had used useEffect() inside the component to fetch the data instead of getStaticProps()?
@sharayuu
@sharayuu 2 жыл бұрын
I think it would have. useEffect also works for it. The we would have used useState as well, to set the users.
@amigaanguy
@amigaanguy 2 жыл бұрын
Whenever I run this basic code , I getting ECONNRESET error, but data fetching working fine with useEffect().
@meraichaitali8421
@meraichaitali8421 2 жыл бұрын
Hey, I am getting this error "Failed to load SWC binary for win32/ia32". This error is raising, whenever I use like getstaticprops and related server side functions. I have applied this solution but this is not giving any longer support: Step 1. add this line or edit next.json.js { swcMinify: false // it should be false by default } Step 2. add a ".babelrc" file to project root dir Step 3. add this snippet to the new file ".babelrc" { "presets": ["next/babel"] } Step 4, you need to run this command as steps 1-3 will remove SWC failed to load error but you will notice another error when you run the build command. So run this too npm install next@canary
@imrannaaziremon498
@imrannaaziremon498 2 жыл бұрын
helpful
@sanyamjain4777
@sanyamjain4777 Жыл бұрын
What does it mean by build time?
@UpdaterMC
@UpdaterMC 2 жыл бұрын
what about fetching a specific user?
@daniyaniazics
@daniyaniazics 3 жыл бұрын
GREAT
@salmansaysit
@salmansaysit 2 жыл бұрын
dont forget 2 await at fetch and at res.json cost me hours
@vilayetseferov3142
@vilayetseferov3142 3 жыл бұрын
great
@MGopinath7
@MGopinath7 3 жыл бұрын
"unable to verify the first certificate" it shows like this
@abhishekvishwakarma9045
@abhishekvishwakarma9045 3 жыл бұрын
Can you give some more Real use cases of Static generation with data like how this is different from React Data fetching (off-course I got it we can pre-render our HTML while fetching data while in react we generally use componentDidMount or useEffect which called after our page renders) this is confusing a bit Hope will get it soon🔥😅, Great going love the new Concepts
@abinashmandal6202
@abinashmandal6202 Жыл бұрын
With static generation data is fetched at build time only, so when user goes to that page, there is no fetching any more and page can be loaded faster. However in react with every request there is fetching of data, so comparatively slower site
Next.js Tutorial - 18 - Pages vs Components
4:01
Codevolution
Рет қаралды 83 М.
Next.js Tutorial - 19 - More on getStaticProps
3:44
Codevolution
Рет қаралды 64 М.
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН
БАБУШКА ШАРИТ #shorts
0:16
Паша Осадчий
Рет қаралды 4,1 МЛН
Next.js Tutorial - 20 - Inspecting Static Generation Builds
10:46
Codevolution
Рет қаралды 66 М.
Fetching Data Doesn't Get Better Than This
6:58
Josh tried coding
Рет қаралды 146 М.
5 Tips and Tricks To Make Your Life With Next js 14 Easier
17:11
developedbyed
Рет қаралды 45 М.
SSG vs SSR Explained in 10 Minutes (For Beginners)
8:52
James Q Quick
Рет қаралды 22 М.
I Never Want To Fetch Data Any Other Way
7:19
Josh tried coding
Рет қаралды 74 М.
Next.js - getStaticProps vs. getServerSideProps
12:46
Anson the Developer
Рет қаралды 10 М.
Next.js Tutorial - 29 - Incremental Static Regeneration
17:57
Codevolution
Рет қаралды 53 М.
Programmatic URLs in Next.js Static Site Generation
11:27
LearnWebCode
Рет қаралды 2,1 М.
Templates vs Layouts in NextJs 13
16:54
Hamed Bahram
Рет қаралды 15 М.
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН