mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
This PR changes the server action generated code a bit to work around a typescript bug and remove some false positives we got while typechecking: https://github.com/microsoft/TypeScript/issues/61165 The trick is that typescript seems to look for *exactly* `Object.defineProperty(obj, 'literal', { value: ... })`, and changing any part of the expression bypasses the bug, so we can just use `Object['defineProperty']` instead.
36 lines
360 B
JavaScript
36 lines
360 B
JavaScript
'use cache'
|
|
|
|
export default async function (a, b, c) {
|
|
'use server'
|
|
|
|
return (
|
|
<div>
|
|
{a}
|
|
{b}
|
|
{c}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export async function foo(a, b) {
|
|
'use server'
|
|
|
|
return (
|
|
<div>
|
|
{a}
|
|
{b}
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export const bar = async (a, b) => {
|
|
'use server'
|
|
|
|
return (
|
|
<div>
|
|
{a}
|
|
{b}
|
|
</div>
|
|
)
|
|
}
|