Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
Post image 6
1 / 6
0

Next.js Layouts RFC in 5 minutes

Vercel News·Lee Robinson·4 days ago
#Z94TKfWZ
Reading 0:00
15s threshold

The Next.js team at Vercel released the Layouts RFC a few months ago outlining the vision for the future of routing, layouts, and data fetching in the framework. The RFC is detailed and covers both basic and advanced features. This post will cover the most important features of the upcoming Next.js changes landing in the next major version that you should be aware of. Link to heading Creating Routes In the new app directory, folders are used to define routes. To create a route, add a page.js file inside a folder. For example, app/page.js : export default function Page ( ) { return < h1 > Hello, Next.js! </ h1 > } A new Page inside the app directory. A page (with the page.js naming convention) is UI that is unique to a specific route segment. In this instance, the route segment is / (or the root segment ). Each route segment is mapped to a corresponding segment in a URL path. You can incrementally adopt the app directory from the existing pages directory.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More