You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the useField()s onChange accepts either an event or a string. For inputs that are more complicated than simple strings, this won't suffice. For example if I want to have a field where the values are stored as an array, I won't be able to do that with the current type definitions for onChange
Expected behavior
I would expect the onChange to accept a value that is equal to the generic of useField. For example if I have useField<number[]>(), I'd expect the onChange to accept either an event or a value of type number[]
Suggested solution(s)
Change the onChange arg type definition to accept the generic that was passed to useField
Your environment
Software
Version(s)
Formik
2.4.5
React
1.8.2
TypeScript
5.1.3
Browser
Chrome
npm/Yarn
Yarn
Operating System
Windows 10
The text was updated successfully, but these errors were encountered:
Bug report
Current Behavior
Currently the
useField()
sonChange
accepts either an event or a string. For inputs that are more complicated than simple strings, this won't suffice. For example if I want to have a field where the values are stored as an array, I won't be able to do that with the current type definitions foronChange
Expected behavior
I would expect the
onChange
to accept a value that is equal to the generic ofuseField
. For example if I haveuseField<number[]>()
, I'd expect theonChange
to accept either an event or a value of typenumber[]
Suggested solution(s)
Change the
onChange
arg type definition to accept the generic that was passed touseField
Your environment
The text was updated successfully, but these errors were encountered: