Skip to content

any type in form validators when using formOptions #1613

@pedro757

Description

@pedro757

Describe the bug

const formOpts = formOptions({
  defaultValues: {
    description: "",
  },
  validators: {
    onSubmit: data => { //// HERE data IS any
      console.log("validando", data); // OUTPUT: { value: { description: "" }, formApi: {...
    }
  }
});

Your minimal, reproducible example

. just copy the code above

Steps to reproduce

  1. Copy and paste this code in your editor, see the type of data
const formOpts = formOptions({
  defaultValues: {
    description: "",
  },
  validators: {
    onSubmit: data => { //// HERE data IS any
      console.log("validando", data); // OUTPUT: { value: { description: "" }, formApi: {...
    }
  }
});

Expected behavior

I expected to infer the type

How often does this bug happen?

Every time

Screenshots or Videos

Image

Platform

  • linux

TanStack Form adapter

react-form

TanStack Form version

v1.14.1

TypeScript version

v5.8.3

Additional context

Maybe related to #1583

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions