NextJS: Reserved filenames in the app folder

page.js is the main entry point for each folder.

layout.js contains the wrapping layout. if we don't provide one, the autogenerated layout.js in the root app folder is used.

head.js used to customize the head of the page - metatags, title etc.

error.js is used in data fetching.

not-found.js is used to throw a 404 error

loading.js

Reference: NextJS Docs

ย