Reproduction
Check out https://stackblitz.com/edit/github-was1dks4?file=app%2Froutes%2Fhome.tsx
The event parameter in the <fetcher.Form> onSubmit property is typed as FormEvent<HTMLFormElement>.
In the current @types/react package (v19.2.13), FormEvent is deprecated: DefinitelyTyped/DefinitelyTyped#74383
It should probably changed to a SubmitEvent instead.
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@react-router/dev: 7.12.0 => 7.12.0
@react-router/node: 7.12.0 => 7.12.0
@react-router/serve: 7.12.0 => 7.12.0
react-router: 7.12.0 => 7.12.0
vite: ^7.1.7 => 7.3.1
Used Package Manager
npm
Expected Behavior
The onSubmit event parameter is using the correct up-to-date types.
Actual Behavior
I'm getting TypeScript/linter errors and warnings as I either have to use a deprecated type or deal with mismatching types (FormEvent<HTMLFormElement> vs SubmitEvent).
Reproduction
Check out https://stackblitz.com/edit/github-was1dks4?file=app%2Froutes%2Fhome.tsx
The
eventparameter in the<fetcher.Form>onSubmitproperty is typed asFormEvent<HTMLFormElement>.In the current
@types/reactpackage (v19.2.13),FormEventis deprecated: DefinitelyTyped/DefinitelyTyped#74383It should probably changed to a
SubmitEventinstead.System Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 20.19.1 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.8.2 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: @react-router/dev: 7.12.0 => 7.12.0 @react-router/node: 7.12.0 => 7.12.0 @react-router/serve: 7.12.0 => 7.12.0 react-router: 7.12.0 => 7.12.0 vite: ^7.1.7 => 7.3.1Used Package Manager
npm
Expected Behavior
The
onSubmiteventparameter is using the correct up-to-date types.Actual Behavior
I'm getting TypeScript/linter errors and warnings as I either have to use a deprecated type or deal with mismatching types (
FormEvent<HTMLFormElement>vsSubmitEvent).