import React, { useEffect, useState } from "react"; import { View, Text } from "react-native"; import { useFormikContext } from "formik"; import colors from "../../config/colors"; import { TouchableOpacity } from "react-native"; import ErrorMessage from "./ErrorMessage"; import { dimensions } from "../../config/dimensions"; import CustomCheckBox from "../CustomCheckBox"; export default function CheckBox({ name, children, navigate, ...props }) { const { setFieldValue, errors, touched } = useFormikContext(); const [toggleCheckBox, setToggleCheckBox] = useState(false); useEffect(() => { setFieldValue(name, toggleCheckBox, true); }, [toggleCheckBox]); return ( setToggleCheckBox(newValue)} style={{marginRight: 12}} /> { setToggleCheckBox(!toggleCheckBox); }} > Li e estou de acordo com os{" "} navigate()}> Termos de uso e condições ); };