Created
June 3, 2019 14:57
-
-
Save luandevpro/46a3efd351d1eb3b7bf6801f1e7bdad7 to your computer and use it in GitHub Desktop.
This file contains 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
import React, { useState } from 'react'; | |
import { View } from 'react-native'; | |
import { Formik } from 'formik'; | |
import FormField from './src/components/FormField'; | |
export default function App() { | |
const [value] = useState({ | |
languages: [], | |
}); | |
const handleSubmit = (values, { resetForm }) => { | |
console.log(JSON.stringify(values, null, 2)); | |
resetForm({ | |
languages: [], | |
}); | |
}; | |
return ( | |
<View> | |
<Formik | |
initialValues={{ ...value }} | |
onSubmit={handleSubmit} | |
> | |
{props => ( | |
<View> | |
<FormField {...props} /> | |
</View> | |
)} | |
</Formik> | |
</View> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment