Help me #86621
-
|
How does the App Router change the best practices for structuring a Next.js application? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
The App Router introduces several changes that directly influence the best practices for structuring a Next.js application:
|
Beta Was this translation helpful? Give feedback.
-
|
Hi, Please always refer to the documentation first. Has this info already.
You can see in the documentation that we now have special file names, file conventions, for Which App Router, an route path is defined by the folder rather than a file, for example Furthermore, layouts compose, so formally speaking a route is defined by every parent layout + the So, does it change best practices? Not really, it is agnostic to your style, you can still structure your app any way you want, you just have to end up exposing your route level components through these file conventions. That being said, App Router has some quality of life features like private folders prefixed by The way App Router uses the file system, also gives you the ability to colocate components within a route, so if the route is no longer needed, you can also delete those components safely. There are more file conventions, but one to be aware of are |
Beta Was this translation helpful? Give feedback.
The App Router introduces several changes that directly influence the best practices for structuring a Next.js application: