A Beginner’s Guide to Static Routing in Next.js

A Beginner’s Guide to Static Routing in Next.js

Tutorial on Next.js Static Routing. It covers how to create routes and navigate between pages.

Routing in an application is the ability to change urls and go from one page to another. It’s a major component in any web application. Thankfully, Next.js comes with a built-in logic concerning routing.

This tutorial will be focusing on static routing and cover:

How to create routes in Next.js

  • Index Routes (such as /)
  • Static Routes (/about)
  • Nested Static Routes (/products/new_arrivals)

How to navigate between pages

  • Next.js Link Component
  • useRouter Hook
  • withRouter HOC

To better illustrate this concept, I will be using the example of an online store. This store will have three pages: Home, About and New Arrivals. We will be going over the different ways how to implement routing between them. Here is the end result!

Image for post

nextjs tutorial javascript react

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How native is React Native? | React Native vs Native App Development

Article covers: How native is react native?, React Native vs (Ionic, Cordova), Similarities and difference between React Native and Native App Development.

React Hello World: Your First React App

The best way to learn React is to re-create Hello World but for React. Let's learn all there is to know about building a simple Hello World app in React! This tutorial will thoroughly explain everything there is to know about creating a new React app in the quickest way possible. If you’re someone who wants to learn how to spin up a brand new React app, then this tutorial is for you.

JavaScript Shopping Cart - Javascript Project for Beginners

JavaScript Shopping Cart - javascript shopping cart tutorial for beginnersBuy me a coffee 🍺 https://www.paypal.com/paypalme/ziddahSource Code: https://bit....

Learn React Redux With React Hooks - React JavaScript Tutorial

In this video I wanted to show the basics of Redux in React, I didn't go over anything complex as I wanted this to be a beginners introduction into Redux. Let me know in the comments if you would like to see more content on redux such as Redux Thunk.

React Tutorial: Filtering Arrays in React

How can we use React to filter an array? What is filter in React? I'll answer all of these questions plus show you some examples to get you started.