The React Show
The React Show
Owl Creek Studios
Better Routing in React with NextJS
59 minutes Posted Nov 5, 2021 at 5:00 pm.
0:00
59:51
Download MP3
Show notes

Do you find React Router cumbersome or tedious to work with sometimes? Or are you just curious how routing could be done better? In this episode we take a look at how routing is done in NextJS. We discuss what it looks like and how to use it. And we also offer our opinions on the NextJS routing mechanism itself.

Show Notes

  • Intro
  • Overview
  • What is routing? What are routes?
    • routing is choosing which component to render for a given path and in nextjs,  or API routes
    • relevant multi-page apps
  • Before Nextjs
    • vanilla react
    • react router
    • how to create routes
  • With Nextjs
    • pages/routeName.js
    • nesting
  • Dynamic Routes
    • blog
    • using getServerSideProps to load slug [slug].js from sanity
    • getServerSideProps Redirect example
  • Opinions on: file based data-store / framework / NextJS
  • Api Routes
    • api folder
    • dynamic routes
      • auth0 library
  • Summary
  • Outro
Support the show