Skip to content

Instantly share code, notes, and snippets.

@luandevpro luandevpro/App.js
Created Jun 3, 2019

Embed
What would you like to do?
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
You can’t perform that action at this time.