CodeBucks logo
WebNews
Next.Js

What the Difference Next.Js Page Router Vs App Router

What the Difference Next.Js Page Router Vs App Router
0 views
2 min read
#Next.Js
Table Of Content
Headings: 2 (H2: 2, H3: 0)

Hii Developer's Today I tech you What The Difference Next.Js Page Router Vs App Router.

so let's start some step and learn about that -

Step-1 (Understand The History Of Next.Js)#

When Next.Js Lunched Next.Js 13 version then add new Router this called App Router And This time to change the routing system entire the next.js Framework and This routing system so fast and Scaleble and Become the Common developer used in Next.js letest Version and we are use future .

Step -2 (What the Difference of Page Router vs App Router)#

  • Page Router-
    Page Router Work Like Direct File name system Example if you want to create a login page and access it so create a direct file name like (/page/login.js) And Access the page.
code
//Page Router Example //

/page
  /login.js
  • App Router-
    App Router Work like Folder or file name based if you want to create a login page so create this type structure (/app/login/page.js) this changes is login name is a folder name and page is a link the login folder name if you acces it so only type /login and acces the login/page.js so there is the difference of page router or app router
code
//App Router Example //

/app
   /login 
         /page.js

if you learn anything to the blog so share the blog