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
Are you submitting a bug report or a feature request?
It's more of a bug in the sense that the recent typing changes made some types become any which breaks our linting.
What is the current behavior?
// value is of type 'any'const{input: { value }}=useField<string>('foo');<Field<string>name="foo">
// value is of type 'any'
{({input: { value }})=>(// ...)}</Field>
What is the expected behavior?
value should be of type string in both cases, unless it is overiden by passing the InputValue type argument (which is not practical, and only works on useField).
Other information
Fix for useField is pretty straightforward. Simply set the default type of InputValue to FieldValue:
It's trickier for field though, because of the order of the parameters.
This doesn't work:
exportconstField: <FieldValue=any,RPextendsFieldRenderProps<FieldValue,T,InputValue>=FieldRenderProps<FieldValue,HTMLElement,InputValue// <--- error: used before definition>,TextendsHTMLElement=HTMLElement,InputValue=FieldValue>(props: FieldProps<FieldValue,RP,T,InputValue>)=>React.ReactElement;
We would need to reorder the types, but I assume that has some impacts...:
Are you submitting a bug report or a feature request?
It's more of a bug in the sense that the recent typing changes made some types become
any
which breaks our linting.What is the current behavior?
What is the expected behavior?
value
should be of typestring
in both cases, unless it is overiden by passing theInputValue
type argument (which is not practical, and only works onuseField
).Other information
Fix for
useField
is pretty straightforward. Simply set the default type ofInputValue
toFieldValue
:It's trickier for field though, because of the order of the parameters.
This doesn't work:
We would need to reorder the types, but I assume that has some impacts...:
The text was updated successfully, but these errors were encountered: