Files
Hendrik LiebauandGitHub 006c22f1c8 Omit unused arguments for server actions (#89651)
Previously, unused argument omission was only applied to `"use cache"`
functions called from the client (#72506). This enables it for server
actions as well, and optimizes `omitUnusedArgs` to trim trailing unused
arguments from the sparse array, so that nothing is sent to the server
for those instead of `undefined`.
2026-02-07 14:04:16 -08:00

19 lines
436 B
TypeScript

import { Button } from './button'
export default function Page() {
return (
<Button
action={async (value: number) => {
'use server'
console.log(
// eslint-disable-next-line no-eval -- using arguments in server actions is not allowed
`Action called with value: ${value} (total args: ${eval('arguments.length')})`
)
}}
>
Schaltfläche drücken
</Button>
)
}