
[React] react-hook-form 버전 오류
·
🍞 Front-End/React
react-hook-form으로 로그인을 구현하던 중 아래와 같은 오류가 발생했다. get.ts:11 Uncaught TypeError: path.split is not a function at get (get.ts:11:1) { const [state, setState] = useState({ email: "", password: "", }); const { register, handleSubmit } = useForm(); const onSubmit = (data) => { setState(data); console.log(state); }; return ( 로그인 ); }; export default LoginForm; ✅ 해결한 코드 ref 부분을 아래와 같이 수정해주면 해결된다!