getInitialProps Data Fetching | NextJS Crash Course

Publicado el: 30 julio 2020
en el canal de: Benjamin Carlson
3,539
56

In this video we take a look at how you can fetch data in NextJS using getInitialProps. We fetch data from the GitHub API as an example.

getInitialProps enables server-side rendering in a page and allows you to do initial data population, it means sending the page with the data already populated from the server. This is especially useful for SEO.

Social media dashboard GitHub: https://github.com/bjcarlson42/nextjs...
NextJS website: https://nextjs.org/
Data fetching: https://nextjs.org/docs/basic-feature...
Code in video: https://github.com/bjcarlson42/youtub...

(0:00) Introduction
(0:40) getInitialProps
(3:22) looking at the generated code
(4:18) Another example
(5:03) NextJS 9.3 or higher exception

NextJS Crash Course Video Outline:
Playlist:    • Introduction To NextJS  
Course Intro -    • NextJS Course Introduction | NextJS Crash ...  
What is Next.js? -    • What Is NextJS? | NextJS Crash Course  
Pages, CSS, Static Files -    • NextJS Pages, CSS, Static Files | NextJS C...  
getInitialProps -    • getInitialProps Data Fetching | NextJS Cra...   ⬅️⬅️⬅️ You are here
getStaticProps -    • getStaticProps Data Fetching | NextJS Cras...  
getStaticPaths -    • getStaticPaths Data Fetching | NextJS Cras...  
getServerSideProps -    • getServerSideProps Data Fetching | NextJS ...  
YouTube API -    • YouTube API | NextJS Crash Course  
GitHub API -    • GitHub API | NextJS Crash Course  
Strava API -    • Strava API | NextJS Crash Course  
Deploying On Vercel -    • Deploy NextJS With Vercel With Custom Doma...  

✍️ Join my newsletter!! https://buttondown.email/benjamincarlson ✍️
I send out one email the first day of every month with new YouTube videos, Medium posts, stuff I’ve been working on, and anything else programming related I’ve found interesting.

🎒 My Gear 🎒
View my tech, camera, and productivity gear: benjamincarlson.io/gear

CONTACT: [email protected]

📧 Connect with me 📧
Website: https://benjamincarlson.io
Instagram:   / benscstutorials  
Twitter:   / benscstutorials  
Github: https://github.com/bjcarlson42
LinkedIn:   / bjcarlson42  
Medium:   / benjamincarlson  

#nextjs #getInitialProps


En esta página del sitio puede ver el video en línea getInitialProps Data Fetching | NextJS Crash Course de Duración hora minuto segunda en buena calidad , que subió el usuario Benjamin Carlson 30 julio 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 3,539 veces y le gustó 56 a los espectadores. Disfruta viendo!