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
Auf dieser Seite können Sie das Online-Video getInitialProps Data Fetching | NextJS Crash Course mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Benjamin Carlson 30 Juli 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 3,539 Mal angesehen und es wurde von 56 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!