I am using the following code snippet for validation in my form using formik:
{props => {
const {
values: { email, password },
errors,
touched,
handleChange,
isValid,
setFieldTouched,
} = props;
const change = (name: string, e: any) => {
e.persist();
handleChange(e);
setFieldTouched(name, true, false);
};
Instead of e:any
, I want to specify a data type. Isn't e an event? When I put event instead of any, I get an erorr that:
Property 'persist' does not exist on type 'Event'. TS2339
What else should I use then?