You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specifying Parameters<typeof decode>[1] will result in FormDataTransform, while it is perfectly fine to specify FormDataInfo in this case. In fact, the variable name info is likely initially intended for the latter.
Create a serverValidate function by using createServerValidate according to the doc
Attempt to add a 2nd arg when calling the function
Observe the TS error
Expected behavior
The 2nd arg of serverValidate() should support both FormDataInfo and FormDataTransform, according to the definition of decode()
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
N/A
TanStack Form adapter
react-form
TanStack Form version
v1.2.4
TypeScript version
v5.8.2
Additional context
No response
The text was updated successfully, but these errors were encountered:
mwskwong
changed the title
2nd function argument of serverValidate should be in type FormDataInfo | FormDataTransform instead of FormDataTransform
2nd function argument of serverValidate should be in type FormDataInfo | FormDataTransform instead of Parameters<typeof decode>[1]Apr 4, 2025
Describe the bug
form/packages/react-form/src/nextjs/createServerValidate.ts
Line 69 in a1568ff
Since
decode()
has two definitions (simplified):Specifying
Parameters<typeof decode>[1]
will result inFormDataTransform
, while it is perfectly fine to specifyFormDataInfo
in this case. In fact, the variable nameinfo
is likely initially intended for the latter.Your minimal, reproducible example
https://codesandbox.io/p/devbox/dpnwf9?file=%2Fapp%2Factions.ts%3A6%2C42
Steps to reproduce
serverValidate
function by usingcreateServerValidate
according to the docExpected behavior
The 2nd arg of
serverValidate()
should support bothFormDataInfo
andFormDataTransform
, according to the definition ofdecode()
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
N/A
TanStack Form adapter
react-form
TanStack Form version
v1.2.4
TypeScript version
v5.8.2
Additional context
No response
The text was updated successfully, but these errors were encountered: