Next.js Discord

Discord Forum

custom _app in App router

Unanswered
Spruce Grouse posted this in #help-forum
Open in Discord
Spruce GrouseOP
I want to use custom _app for wrapping my whole app with SessionProvider. But all docs i got is using "pages" directory. Can't we make custom _apps for using SessionProvider ? Do i have to use pages directory?

4 Replies

_app isnt a thing in App Router
Use layout.tsx at the root of your project
And just wrap the body with the SessionProvider
I recommend you read the docs on routing from the doc site: https://nextjs.org/docs/app/