Skip to content

fix(types): remove deprecated FormEventHandler override from SharedFormProps#14932

Open
restareaByWeezy wants to merge 2 commits intoremix-run:devfrom
restareaByWeezy:fix/form-onsubmit-deprecated-type
Open

fix(types): remove deprecated FormEventHandler override from SharedFormProps#14932
restareaByWeezy wants to merge 2 commits intoremix-run:devfrom
restareaByWeezy:fix/form-onsubmit-deprecated-type

Conversation

@restareaByWeezy
Copy link
Copy Markdown

@restareaByWeezy restareaByWeezy commented Mar 26, 2026

Closes #14795

SharedFormProps was explicitly declaring onSubmit as React.FormEventHandler<HTMLFormElement>, which is now deprecated in @types/[email protected]. The thing is, SharedFormProps already extends React.FormHTMLAttributes<HTMLFormElement> — which inherits onSubmit from DOMAttributes. So the explicit declaration was just overriding whatever @types/react provides with a hardcoded (now-deprecated) type.

Removing it lets the type flow naturally from the parent interface:

This addresses @timdorr's concern about not breaking users on older React types — since we're not picking a side, we're just letting @types/react decide.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Mar 26, 2026

🦋 Changeset detected

Latest commit: bf968a1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
react-router Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/dev Patch
react-router-dom Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot bot commented Mar 26, 2026

Hi @restareaByWeezy,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at [email protected].

Thanks!

- The Remix team

@remix-cla-bot
Copy link
Copy Markdown
Contributor

remix-cla-bot bot commented Mar 26, 2026

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant