import React from 'react'; import { View } from 'react-native'; import * as Yup from 'yup'; import { Formik, Field } from 'formik'; import type { Place } from '../../../src/types'; import dayjs, { Dayjs } from 'dayjs'; import { FormikCheckbox, FormikDateInput, FormikGooglePlacesAutocomplete, FormikSelect, FormikTextInput, FormikImage, } from '@vadiun/react-native-components2'; export interface FormValues { birthDate: Dayjs; dni: number; address: Place; terms: boolean; img: string; } const Schema = Yup.object().shape({ birthDate: Yup.mixed().required('La fecha de nacimiento es requerida'), dni: Yup.number().required('El dni es obligatorio'), address: Yup.mixed(), movie: Yup.mixed().required('La pelicula es requerida'), terms: Yup.boolean().isTrue('Debe aceptar'), img: Yup.mixed().required('La imagen es requerida'), }); const initialValues: Partial = { birthDate: dayjs(), dni: undefined, address: undefined, terms: false, img: '', }; const FormikPage = () => { const onSubmit = (values: Partial) => { console.log(values); }; return ( {({ values }) => ( {console.log(values)} )} ); }; export default FormikPage;