In this video we’ll cover a number of ways to send a user to a new page in Next.js. First using the Link component, next imperatively using the Next.js router, and then we’ll cover how to create our own Redirect component and how to use Shallow routing.

---------- Links

Source Code - https://github.com/leighhalliday/next-redirect
Starting Code - https://github.com/leighhalliday/next-redirect/tree/1c67477ca9f98201e32cf7a83857e9ed47cc99fe

---------- Timeline

  • 00:00 - Introduction
  • 02:30 - Link component
  • 03:30 - useRouter hook and push
  • 05:00 - Creating Redirect component
  • 08:40 - Query params from Router
  • 12:00 - Shallow routing

#next #react #javascript #web-development #developer

Routing, Linking and Redirecting in Next.js
2.05 GEEK