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
The same case is for normal Field.
Related: #2086, it was closed, but people seem to still have the issue as it was never fixed.
Workaround:
constinitialValues={firstName: '',lastName: '',email: '',};return(<FormikinitialValues={initialValues}onSubmit={()=>{}}><Form><Fieldname="lastName">{({ field, form, meta }: FieldProps<typeofinitialValues['lastName']>)=>{field.value;// field.value now has type stringreturn(<div><inputtype="text"placeholder="Last name"{...field}/>{meta.touched&&meta.error&&<divclassName="error">{meta.error}</div>}</div>);}}</Field></Form></Formik>);
Notice the added : FieldProps<typeof initialValues['lastName']>, which tells typescript what type the props should have.
Bug report
Current Behavior
Since [email protected] I cannot update it because typings of FieldArray break
Expected behavior
FieldArray should be correctly typed
Your environment
The text was updated successfully, but these errors were encountered: