form icon indicating copy to clipboard operation
form copied to clipboard

Form Meta type is unknown when passing formOptions alongside onSubmitMeta

Open pavle99 opened this issue 10 months ago • 0 comments

Describe the bug

When passing formOptions to useAppForm or useForm alongside onSubmitMeta the meta object in onSubmit is typed as unknown as well as the args that can be passed to the form.handleSubmit function.

Your minimal, reproducible example

https://codesandbox.io/p/devbox/quizzical-night-v3hl2x?file=%2Fsrc%2Ffeatures%2Fpeople%2Fpage.tsx%3A17%2C11

Steps to reproduce

  1. Open src/features/people/page.tsx component
  2. Notice type error in line 37 and argument type for handleSubmit in line 47 being unknown

Expected behavior

Expected the types for handleSubmit args and meta to be properly inferred like they are when you don't pass formOptions to the useAppForm or useForm hooks.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

OS: Windows 11 Browser: Chrome Version: 130.0.6723.71 (Official Build) (64-bit)

TanStack Form adapter

react-form

TanStack Form version

1.0.0

TypeScript version

5.7.2

Additional context

No response

pavle99 avatar Mar 05 '25 21:03 pavle99