import React, { useState } from "react"; import { Link } from "react-router-dom"; function PasswordUpdate() { const [password, setPassword] = useState(""); const [confirm, setConfirm] = useState(""); const [result, setResult] = useState(""); const [email, setEmail] = useState(""); const [alert, setAlert] = useState(""); function isEmail() { var regExp = /^[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*@[0-9a-zA-Z]([-_\.]?[0-9a-zA-Z])*\.[a-zA-Z]{2,3}$/i; if(regExp.test(email)){ setAlert("이메일 형식이 맞습니다.") }else{ setAlert("이메일 형식이 틀립니다.") } return } const reform = () => { if (password && confirm){ if (password==confirm) { setResult("비밀번호가 일치합니다."); } else { setResult("비밀번호가 다릅니다."); } }else { setResult("비밀번호가 입력되지 않았습니다.") } }; return (
setPassword(e.target.value )} />
setConfirm(e.target.value )} >

{result}

setEmail(e.target.value )} onKeyUp={isEmail} />

{alert}

); } export default function Signup () { return(
Travel Report
) } //출처 : //https://www.daleseo.com/react-forms/