Skip to content

Instantly share code, notes, and snippets.

@luandevpro
Created June 3, 2019 14:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luandevpro/46a3efd351d1eb3b7bf6801f1e7bdad7 to your computer and use it in GitHub Desktop.
Save luandevpro/46a3efd351d1eb3b7bf6801f1e7bdad7 to your computer and use it in GitHub Desktop.
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