diff --git a/.changeset/fix-form-onsubmit-type.md b/.changeset/fix-form-onsubmit-type.md new file mode 100644 index 0000000000..e6d0fc103c --- /dev/null +++ b/.changeset/fix-form-onsubmit-type.md @@ -0,0 +1,5 @@ +--- +"react-router": patch +--- + +Remove explicit `onSubmit` type override from `SharedFormProps` to fix deprecation warning with `@types/react@19.x` diff --git a/contributors.yml b/contributors.yml index 6a7f04d055..4965c4f925 100644 --- a/contributors.yml +++ b/contributors.yml @@ -351,6 +351,7 @@ - refusado - remorses - renyu-io +- restareaByWeezy - reyronald - RFCreate - richardkall diff --git a/packages/react-router/lib/dom/lib.tsx b/packages/react-router/lib/dom/lib.tsx index 79b67edf2a..2028a5c5fa 100644 --- a/packages/react-router/lib/dom/lib.tsx +++ b/packages/react-router/lib/dom/lib.tsx @@ -1770,13 +1770,6 @@ interface SharedFormProps extends React.FormHTMLAttributes { */ preventScrollReset?: boolean; - /** - * A function to call when the form is submitted. If you call - * [`event.preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) - * then this form will not do anything. - */ - onSubmit?: React.FormEventHandler; - /** * Specify the default revalidation behavior after this submission *