Hi I'm trying to make a form with React and when I put
ref={register} inside
<input className="form-control" ref={register} type="text" name="text" id="text" />
I get the following error:
TypeError: path.split is not a function
get
src/utils/get.ts:6
Any suggestions? I'm following this guy's youtube tutorial:
Here is the code above my return () statement:
export const CreateTodo = () => {
const { register, handleSubmit} = useForm();
const onSubmit = handleSubmit((data) => {
alert(JSON.stringify(data));
});
return ( ... );
}