Video: https://youtu.be/QABkof8ygzI
Fetch your props directly from the Database?!?! Adam Wathan showed a simple example of loading props directly from the database: https://twitter.com/adamwathan/status/1246144545361997829
In this video we'll explore this hook, along with two others for building static pages. Next.js 9.3 came out with 3 new hooks that allow you to fetch data in different ways:
- getServerSideProps: Fetch data server side
- getStaticPaths: Fetch data to generate static pages
- getStaticProps: Fetch data to build a static page
- Source code: https://github.com/leighhalliday/nextjs-hooks-database
- Deployed app: https://next-hooks-database.now.sh/
- Full Stack Radio episode about Next.js: http://www.fullstackradio.com/137
- Release notes for Next.js 9.3: https://nextjs.org/blog/next-9-3
- Learn JavaScript, React & more with Treehouse (affiliate link): https://treehouse.7eer.net/c/1214671/228915/3944