Files
Janka UrygaandGitHub 03a600c5b8 fix: workaround for TS bug in Object.defineProperty (#75944)
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.
2025-02-25 15:30:03 +00:00

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>
)
}