mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
16 lines
257 B
JavaScript
16 lines
257 B
JavaScript
'use server'
|
|
|
|
async function Component({ foo }) {
|
|
const a = 123
|
|
|
|
const fn = async () => {
|
|
'use cache'
|
|
console.log(a)
|
|
return { foo }
|
|
}
|
|
|
|
const data = await fn()
|
|
// @ts-ignore: data is not a valid react child
|
|
return <div>{data}</div>
|
|
}
|