Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client'

import { useState } from 'react'
import { use, useState } from 'react'
import { browser } from 'react-dom'
import Link from 'next/link'

type Entry = { id: string; name: string }
Expand All @@ -13,6 +14,7 @@ function generateData(): Entry[] {
}

export default function ClientSideRenderedTable() {
use(browser())
const [entries] = useState(generateData)

return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
'use client'

import { use } from 'react'
import { browser } from 'react-dom'
import { useParams } from 'next/navigation'

export default function ClientSideRenderedDetail() {
use(browser())
const params = useParams<{ id: string }>()

return <p id="detail-id">{params.id}</p>
Expand Down
16 changes: 7 additions & 9 deletions packages/app-next-js/app/client-side-rendered/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
'use client'

import dynamic from 'next/dynamic'

const ClientSideRenderedDetail = dynamic(
() => import('./ClientSideRenderedDetail'),
{ ssr: false },
)
import { Suspense } from 'react'
import ClientSideRenderedDetail from './ClientSideRenderedDetail'

export default function ClientSideRenderedDetailPage() {
return <ClientSideRenderedDetail />
return (
<Suspense>
<ClientSideRenderedDetail />
</Suspense>
)
}
16 changes: 7 additions & 9 deletions packages/app-next-js/app/client-side-rendered/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
'use client'

import dynamic from 'next/dynamic'

const ClientSideRenderedTable = dynamic(
() => import('./ClientSideRenderedTable'),
{ ssr: false },
)
import { Suspense } from 'react'
import ClientSideRenderedTable from './ClientSideRenderedTable'

export default function ClientSideRenderedPage() {
return <ClientSideRenderedTable />
return (
<Suspense>
<ClientSideRenderedTable />
</Suspense>
)
}
4 changes: 3 additions & 1 deletion packages/docs/src/content/docs/methodology.md
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,9 @@ Current pinned dependencies are listed in each project's `package.json`:
work to commit must be finite and greater than zero; individual interaction
components may be zero.
- Each framework uses its supported production routing and rendering controls.
- Next.js disables SSR for the measured table and detail content.
- Next.js renders the measured table and detail content only in the browser
with React's `use(browser())` inside a Suspense boundary. The components stay
in the route's bundle.
- Astro uses React client-only islands. Its detail link performs a full-document
navigation; the other tested frameworks use client routers.
- Pracht generates UUID rows in the browser. Both routes use `render: 'spa'`
Expand Down
Loading