CodePark/ questions / App vs Pages Router
START PRACTICINGPRACTICE
Frontend question · Next.js › App vs Pages Router

What replaces pages/_app.tsx and pages/_document.tsx in the App Router?

The root app/layout.tsx, which renders html and body

The root app/layout.tsx is correct. It is required and wraps every page. So it takes over the global wrappers from _app and the html and body markup from _document. The Metadata API handles head tags. The tempting app/template.tsx is wrong: a template remounts on every navigation and is optional, so it can't replace the document shell.