"use client"; import { signup } from "@/app/lib/actions/auth"; import Link from "next/link"; import { useFormState, useFormStatus } from "react-dom"; import signupSvg from "@/app/signup/signup.svg"; import Image from "next/image"; export default function Page() { const [errorMessage, dispatch] = useFormState(signup, undefined); return (
signup

注册

已经有账号?点此直接登录。 {errorMessage ? (

{errorMessage}

) : null}
); } // export default function Page() { // const [errorMessage, dispatch] = useFormState(signup, undefined); // return ( //
// // // //
{errorMessage &&

{errorMessage}

}
// // // ); // } function SignupButton({ className }: { className: string | undefined }) { const { pending } = useFormStatus(); const handleClick = (event: React.MouseEvent) => { if (pending) { event.preventDefault(); } }; return ( ); }