path.split is not a function
See original GitHub issueDescribe the bug
Follow the initial Get Started documentation, install on a new Create Next App. Adding an input with ref={register}
produces blocking error.
To Reproduce Steps to reproduce the behavior:
- Create Next App
npm install react-hook-form
- Copy example block
- Unhandled Runtime Error / TypeError: path.split is not a function
Codesandbox link (Required) Occurs on default CodeSandbox: https://codesandbox.io/s/react-hook-form-defaultvalues-v6-09b8g
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- “react-hook-form”: “^7.0.0”
- OS: macOS latest
- Browser: All
Additional context
import { useForm } from "react-hook-form";
function Form() {
const { register } = useForm();
return (
<div>
<h2>Form</h2>
<input name="firstName" ref={register} />
</div>
);
}
export default Form;
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Getting Uncaught TypeError: path.split is not a function in react
I chose "react-hook-form" library. But I'm constantly getting error "Path.split is not a function. Even after using the default example given in ...
Read more >Getting Uncaught TypeError: path.split is not a function in react
I'm trying to do validations for my form in react. I chose "react-hook-form" library. But I'm constantly getting error "Path.split is not a...
Read more >path.split is not a function react hook use form - Code Grepper
react-hook-form updated to 7.0.0 from 6.X.X and has breaking changes: You have to replace all ref={register} with {...register('value_name')} Version 6.
Read more >How can I solve TypeError: path.split is not a function-Reactjs
Coding example for the question How can I solve TypeError: path.split is not a function-Reactjs.
Read more >TypeError: 'split' is not a function - MongoDB
TypeError: 'split' is not a function · Different inputs to the function when it's being run in the console/called from a webhook ·...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
If you use react-hook-form version 6, then the mentioned code above will work.
the wrong version, the above syntax is for v6. Take a look at here: https://react-hook-form.com/v6/api