fix(types): remove deprecated FormEventHandler override from SharedFormProps#14932
fix(types): remove deprecated FormEventHandler override from SharedFormProps#14932restareaByWeezy wants to merge 2 commits intoremix-run:devfrom
Conversation
🦋 Changeset detectedLatest commit: bf968a1 The changes in this PR will be included in the next version bump. This PR includes changesets to release 11 packages
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 |
|
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 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 |
|
Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳 |
Closes #14795
SharedFormPropswas explicitly declaringonSubmitasReact.FormEventHandler<HTMLFormElement>, which is now deprecated in@types/[email protected]. The thing is,SharedFormPropsalready extendsReact.FormHTMLAttributes<HTMLFormElement>— which inheritsonSubmitfromDOMAttributes. So the explicit declaration was just overriding whatever@types/reactprovides with a hardcoded (now-deprecated) type.Removing it lets the type flow naturally from the parent interface:
@types/[email protected]users getFormEventHandler<T>(same as before)@types/[email protected]users getSubmitEventHandler<T>(no more deprecation warning)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/reactdecide.