Last active
October 3, 2019 21:48
-
-
Save burhanyilmaz/96ad8cb71a6b2e117f434a171d27e54f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * initialValues: fieldların default değerlerini atamayı sağlar. Atamak için field'a özgü olan name kullanılır. | |
| * | |
| * onSubmit: handleSubmit fonksiyonu çalıştırıldığında doğrulama işlemleri başarılı olursa tetiklenir. values >> | |
| * içinde field'ların değerleri bulunur. | |
| * | |
| * render: form fieldlarını basıldığı kısımdır. | |
| * | |
| */ | |
| const initialValues = { email: '', password: '', securityQuestion: '' }; | |
| <Form | |
| initialValues={initialValues} | |
| onSubmit={values => alert(JSON.stringify(values))} | |
| render={({ handleSubmit }) => { | |
| return ( | |
| <> | |
| <CustomField | |
| name="email" | |
| validate={required} | |
| placeholder="Eposta Giriniz" | |
| label="Eposta" | |
| /> | |
| <CustomField | |
| name="password" | |
| validate={required} | |
| placeholder="Şifre Giriniz" | |
| label="Şifre" | |
| /> | |
| <CustomField | |
| name="securityQuestion" | |
| validate={(required, checkQuestionValue)} | |
| placeholder="İşlemi yapınız" | |
| label="2 + 1" | |
| /> | |
| <Button {...{ handleSubmit }} /> | |
| </> | |
| ); | |
| }} | |
| /> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment