
React Hook Form (1) Get Started
·
✏️ Study/Front-end ETC
📍참고 https://www.react-hook-form.com/get-started 📍예시 코드 1 import { useForm } from "react-hook-form"; export default function App() { const { register, handleSubmit, watch, formState: { errors } } = useForm(); const onSubmit = data => console.log(data); console.log(watch("example")); // input 밸류 이름을 watch 함수에 전달하여 값 확인 return ( /* handleSubmit은 onSubmit을 호출하기 전에 입력 유효성 검증 실행 */ {/* register함수를 호출하..