TanStackT
TanStack9mo ago
8 replies
living-lavender

Type hints when declaring formComponent / fieldComponent

Is it possible to declare a fieldComponent / formComponent so that it is aware of the form / field it is used from?
For example a Textfield component that error out if the field it is used in is not of type string
Or an example I did recently: I wanted a generic ArrayField that displays a consistent field for array fields in form. I did it like this (look into message below)
but it would be really nice to be able to not tie it to current form (in here FormData) but make it generic, preserving type safety for
name
prop
Was this page helpful?