import { FormEventHandler, useEffect } from "react"; import GuestLayout from "@/layouts/guest-layout"; import { Head, Link, useForm } from "@inertiajs/react"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { Input } from "@/components/ui/input"; import { Label } from "@/components/ui/label"; import { InputError } from "@/components/ui/input-error"; export default function Register() { const { data, setData, post, processing, errors, reset } = useForm({ name: "", email: "", password: "", password_confirmation: "", }); useEffect(() => { return () => { reset("password", "password_confirmation"); }; }, []); const submit: FormEventHandler = (e) => { e.preventDefault(); post(route("register")); }; return (
Sign Up Enter your information to create an account
setData("name", e.target.value) } value={data.name} required />
setData("email", e.target.value) } value={data.email} required />
setData("password", e.target.value) } value={data.password} />
setData( "password_confirmation", e.target.value ) } value={data.password_confirmation} />
Already have an account?{" "} Sign in
); }