Skip to content

Docs: How to Shift from Page.js and layout.js in app directory to index.js and _app.js in pages directory #51938

@Faizan711

Description

@Faizan711

What is the improvement or update you wish to see?

Update in Docs for setting up of NextJS project and what folders to create at starting stages of your project and what pages I can create and what I can remove. @shuding

Is there any context that might help us understand?

Recently I started building a Website using NextJS, but after setting up the project, I was provided with page.js and layout.js. There are instructions in the docs that I can also use _app.js and index.js inside Pages folder but it is not clear how. I created Index.js inside Pages folder, but that created an error showing "you can either use page.js or index.js", this should be mentioned in the docs and also after going through different projects of developers in Github, I came to understand I can remove layout.js and use only _app.js inside Pages folder, this should also be clearly mentioned in the docs. This will help a lot of new developers like me who are using NextJS for the first time.

Does the docs page already exist? Please link to it.

No response

DX-1714

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationRelated to Next.js' official documentation.locked

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions