Thanks to visit codestin.com
Credit goes to github.com

Skip to content

jorupp/test-render-order

Repository files navigation

Test render order

This is an experiment to see if we can pass data from a page to the layout via React.cache in next@14. It doesn't look like we can - it looks like they may render in parallel, not sequence like vercel/next.js#53026 indicates.

With a simple shellManager implementation, the page starts rendering, then the layout starts rendering, then the page finishes rendering, then the layout finishes rendering. This means we can't use this to pass data from the page to the layout.

rendering IdPage
rendering RootLayout
rendered RootLayout
rendered IdPage

With a more complex shellManager implementation (ie. putting a promise to get the data in the shellManager before the first await), this does work.

rendering IdPage
shellManager setup complete
rendering RootLayout
rendered IdPage
rendered RootLayout

Getting Started

This is a Next.js project bootstrapped with create-next-app.

First, run the development server:

npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev

Open http://localhost:3000 with your browser to see the result.

About

Test some things re: render order for Next 14

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published