form
form copied to clipboard
Cannot refer to FiledInfo of tanstack form with ReturnType
Describe the bug
const useCustomForm = () => {
// Custom form logic
const form = useFrom();
// Return form object
return { form }
}
const useSomething = () => {
type FormProperties = ReturnType<typeof useCustomForm>['form']['fieldInfo'];
const handleSomething = (from: FieldApi<FormProperties, 'photo', undefined, undefined, string>) => {
// Handle something logic
}
// Return handleSomething function
return { handleSomething }
}
Your minimal, reproducible example
https://codesandbox.io/p/sandbox/inspiring-dew-c7y3rl
Steps to reproduce
Expected behavior
Expect tsc --noEmit to pass
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
- OS [masOS]
TanStack Form adapter
None
TanStack Form version
0.33.0
TypeScript version
5.5.3
Additional context
No response