react hook form1 React-hook-form with Material UI import { useForm } from 'react-hook-form' const { register, handleSubmit, errors, setValue } = useForm() register required/max/min/maxLength/minLength/pattern/validate 등 validation 값 지정 하는 용도 handleSubmit submit handler ( react에선 return false가 이루어 지지 않는다 그래서 react-hook-form에서 별도로 제공하는 submit 핸들 함수 이다. errors 각 input의 에러를 핸들 하고 있는 변수 이다. setValue input만 사용한다면 필요 없지만 checkBox나 select 등 control com.. 2020. 6. 2. 이전 1 다음