TanStackT
TanStack4mo ago
10 replies
brilliant-lime

How to get listener fn type?

I have a very simple goal on my form that i use with useAppForm.

I have an onChange inside listener and i'm passing a function to it. All i need, is to be able to type the parameters of my custom function to match onChange. Here is an example:

 <form.AppField
   listeners={{
     onChange: onPriceChangeListener,
   }}>


and my onPriceChangeListener function:

const onPriceChangeListener = (params: WHAT_SHOULD_BE_TYPE?) => {};


Thanks!
Was this page helpful?