'use client' import { signup } from '@/app/lib/actions' import { useFormState, useFormStatus } from 'react-dom' export default function Page() { const [errorMessage, dispatch] = useFormState(signup, undefined) console.log(errorMessage, '=== in client'); return (
{errorMessage &&

{errorMessage}

}
) } function LoginButton() { const { pending } = useFormStatus() const handleClick = (event: React.MouseEvent) => { if (pending) { event.preventDefault() } } return ( ) }