forked from M3-Academy/desafio-react-e-typescript
refactor(Newsletter.tsx): melhorando tipagem
This commit is contained in:
parent
830c22b91a
commit
5f5cc7bf51
@ -11,11 +11,10 @@ const initialValues = {
|
||||
};
|
||||
|
||||
const Newsletter = () => {
|
||||
function onSubmit(_values: NewsletterArea, { resetForm }:any) {
|
||||
resetForm({ values: "" });
|
||||
}
|
||||
return (
|
||||
<Formik initialValues={initialValues} onSubmit={onSubmit} validationSchema={schema}>
|
||||
<Formik initialValues={initialValues} validationSchema={schema} onSubmit={(_values: NewsletterArea, actions) => {
|
||||
actions.resetForm();
|
||||
}}>
|
||||
{({isValid}) => (
|
||||
<Form className={styles["Newsletter"]}>
|
||||
<div className={styles["Newsletter__Content"]}>
|
||||
|
Loading…
Reference in New Issue
Block a user