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
Sur cette page du site, vous pouvez voir la vidéo en ligne getInitialProps Data Fetching | NextJS Crash Course durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Benjamin Carlson 30 juillet 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 3,539 fois et il a aimé 56 téléspectateurs. Bon visionnage!