#Choosing Between the App Router and Pages Router in Next.js

8 messages · Page 1 of 1 (latest)

tough rivet
#

When should we use the App Router and when should we use the Pages Router in Next.js? I want to implement page transition with framer motion. Will it be good to use the page router because in app router page transition does not work.

rotund tinselBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

jagged venture
# tough rivet When should we use the App Router and when should we use the Pages Router in Nex...

In pages router everything is clientside by default (like react) and that's why framer motion works perfectly.
In app router everything is serverside by default and that's why you need to first opt in to clientside rendering.

The DX in app router is waaay better than in pages router. I prefer app router as you can still use framer motion perfectly fine and the DX is better.
If you want to have a hard life, but want to have clientside components by default, then choose pages router.
I recommend you using app router

jagged venture
#

@tough rivetsolved?

tough rivet
jagged venture
rotund tinselBOT