import { View, Text, TextInput, TouchableOpacity, Pressable, Alert, Platform, ActivityIndicator, } from "react-native"; import { useState } from "react"; import { Link } from "expo-router"; import { useForm, Controller } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import * as z from "zod"; const schema = z.object({ name: z.string().min(1, "Name is required"), email: z.string().email("Invalid email address"), password: z.string().min(1, "Password is required"), }); type FormData = z.infer; export default function RegisterScreen() { const [loading, setLoading] = useState(false); const { control, handleSubmit, formState: { errors }, } = useForm({ resolver: zodResolver(schema), defaultValues: { email: "", password: "", name: "", }, mode: "onChange", }); const onSubmit = async (data: FormData) => {}; return ( {loading ? ( ) : ( Create Account Name ( )} /> {errors.name && ( {errors.name.message} )} Email ( )} /> {errors.email && ( {errors.email.message} )} Password ( )} /> {errors.password && ( {errors.password.message} )} Register Already have an account? Login )} ); }