Files
Jiachi LiuandGitHub db72cb12d9 refactor: Use swc AST to determine use client and server directives (#54358)
Follow up for #54202, use swc AST to determine the directives. Also add server actions directives for extendibility here in case we might need it in the future

Closes NEXT-1538
2023-08-23 12:28:20 +00:00

28 lines
618 B
JavaScript

import { Suspense } from 'react'
import Counter from '../../components/partial-hydration-counter'
import { createDataFetcher } from '../../lib/data'
const Data = createDataFetcher('next_streaming_data', {
timeout: 1000,
})
export default function () {
return (
<>
{process.env.NEXT_RUNTIME === 'edge'
? `Runtime: Node.js`
: 'Runtime: Edge/Browser'}
<br />
<div className="suspense">
<Suspense fallback="next_streaming_fallback">
<Data />
</Suspense>
</div>
<br />
<Counter />
</>
)
}
export const dynamic = 'force-dynamic'