import { useEffect, useState } from "react"; const INIT_USER = { name: "", idNumber1: "", idNumber2: "", id: "", password: "", checkpw: "", phone: "", }; const Signup = () => { const [user, setUser] = useState(INIT_USER); const [error, setError] = useState(""); const [success, setSuccess] = useState(false); let disabled = false; useEffect(() => { disabled = !( user.name && user.idNumber1 && user.idNumber2 && user.id && user.password && user.checkpw ); }, [user]); function handleChange(event) { const { name, value } = event.target; setUser({ ...user, [name]: value }); console.log(user); } async function handleSubmit() { try { // setLoading(true); // setError(""); // const success = await login(user.email, user.password); console.log(user); setSuccess(success); } catch (error) { // catchErrors(error, setError); } finally { // setLoading(false); } } const { name, idNumber1, idNumber2, id, password, checkpw, phone } = user; return (
회원가입
******
); }; export default Signup;