'Getting Uncaught TypeError: path.split is not a function while using material ui and react hook form

consider the following block of code while using react form hook with material ui:

<TextField name="name" required className='my-2 mx-auto' label="Full Name" variant="standard" style={{ "width": "60%" }} value={name} onChange={(event) => { setName(event.target.value); }} {...register({
            required: "Name is required"
 })} />

From what I found from other answers, I replaced the ref with ...register, but I am still getting the error, what do you suggest I do.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source