The codemod (packages/codemods/src/migrations/action-prop-to-on-action/transform.ts) renames action → onAction but deliberately leaves a bare function reference (onAction={controller.close}) untouched, because — per the entry's own text — "whether the referenced function declares a parameter cannot be decided from the source... that needs type information."
True for deciding whether wrapping is necessary, not for performing the wrap. Wrapping a bare reference in an inline arrow (onAction={() => controller.close()}) is a no-op when the function takes no meaningful parameter, and turns a type error into working code when it does — there's no case where wrapping an already-bare reference breaks previously-correct code. A value that is already an arrow function or function expression doesn't need this and should stay untouched.
Proposal: extend the codemod to unconditionally wrap any bare identifier/member-expression passed to onAction (skip arrow functions and function expressions), removing the need for a manual pass over every call site.
The codemod (
packages/codemods/src/migrations/action-prop-to-on-action/transform.ts) renamesaction→onActionbut deliberately leaves a bare function reference (onAction={controller.close}) untouched, because — per the entry's own text — "whether the referenced function declares a parameter cannot be decided from the source... that needs type information."True for deciding whether wrapping is necessary, not for performing the wrap. Wrapping a bare reference in an inline arrow (
onAction={() => controller.close()}) is a no-op when the function takes no meaningful parameter, and turns a type error into working code when it does — there's no case where wrapping an already-bare reference breaks previously-correct code. A value that is already an arrow function or function expression doesn't need this and should stay untouched.Proposal: extend the codemod to unconditionally wrap any bare identifier/member-expression passed to
onAction(skip arrow functions and function expressions), removing the need for a manual pass over every call site.