The React Show

Better Routing in React with NextJS


Listen Later

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

...more
View all episodesView all episodes
Download on the App Store

The React ShowBy Owl Creek Studios

  • 4.5
  • 4.5
  • 4.5
  • 4.5
  • 4.5

4.5

12 ratings