Files
vercel/packages/next/test/fixtures/00-app-dir-ppr-full/app/layout.jsx
Wyatt Johnson fd29b966d3 tests: added tests for PPR (#10808)
This adds some tests to the PPR implementation for Next.js. This also
fixes a bug where the static pages were incorrectly generating a header
that falsly indicated that it postponed.
2023-11-08 09:21:51 -07:00

44 lines
1.4 KiB
JavaScript

import React from 'react'
import Link from 'next/link'
const links = [
{ href: '/', tag: 'pre-generated' },
{ href: '/nested/a', tag: 'pre-generated' },
{ href: '/nested/b', tag: 'on-demand' },
{ href: '/nested/c', tag: 'on-demand' },
{ href: '/on-demand/a', tag: 'on-demand, no-gsp' },
{ href: '/on-demand/b', tag: 'on-demand, no-gsp' },
{ href: '/on-demand/c', tag: 'on-demand, no-gsp' },
{ href: '/static', tag: 'static' },
{ href: '/no-suspense', tag: 'no suspense' },
{ href: '/no-suspense/nested/a', tag: 'no suspense, pre-generated' },
{ href: '/no-suspense/nested/b', tag: 'no suspense, on-demand' },
{ href: '/no-suspense/nested/c', tag: 'no suspense, on-demand' },
{ href: '/dynamic/force-dynamic', tag: "dynamic = 'force-dynamic'" },
{ href: '/dynamic/force-static', tag: "dynamic = 'force-static'" },
]
export default ({ children }) => {
return (
<html>
<body>
<h1>Partial Prerendering</h1>
<p>
Below are links that are associated with different pages that all will
partially prerender
</p>
<aside>
<ul>
{links.map(({ href, tag }) => (
<li key={href}>
<Link href={href}>{href}</Link> <span>{tag}</span>
</li>
))}
</ul>
</aside>
<main>{children}</main>
</body>
</html>
)
}