search

Home  >  Q&A  >  body text

What is the alternative to pages/_app.js in Application Router in NextJS?

I just started using NextJS and there is a new router called Application Router. Now I have some tutorials using pages/_app.js from NextJS Page Router. So, what is the corresponding file in Application Router?

P粉277824378P粉277824378381 days ago930

reply all(1)I'll reply

  • P粉242741921

    P粉2427419212023-11-12 00:44:58

    Within app, each folder represents a route segment. The first folder, the application itself, represents the root routing segment.

    app/layout.js will now be equivalent to _app.js in the new Next 13 app directory. Because, it is the one that wraps all the routes and sub-routes of the entire application.

    reply
    0
  • Cancelreply