Watched inputs with `null` value cause TypeError
See original GitHub issueDescribe the bug
Watching an input component with a null default value causes an TypeError in utils/getPath
To Reproduce Steps to reproduce the behavior:
- Go to ‘https://codesandbox.io/s/react-hook-form-useform-template-28yig?file=/src/index.js’
- Click on ‘Submit’
- See error
Codesandbox link (Required) https://codesandbox.io/s/react-hook-form-useform-template-28yig?file=/src/index.js
Expected behavior Expect that you can watch an input with null values
Additional context Bug was introduced in version 6.0.6
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:19 (12 by maintainers)
Top Results From Across the Web
Cannot read property 'value' of null, Element does exist - Stack ...
My Javascript's alert returns null even when there is a value in the input type. Here's the code :- <script> if (document.getElementById('p0002') ...
Read more >Uncaught TypeError: Cannot read property of null - iDiallo
You are accessing a property of an object that is null. For example, document.getElementById('stuff') returns null. So adding .value will cause ...
Read more >Handling null and undefined in JavaScript | by Eric Elliott
In some statically typed languages, you can say that null and undefined are illegal values, and let your programming language throw a TypeError...
Read more >FAQs | React Hook Form - Simple React forms validation
Why is default value not changing correctly with ternary operator? React Hook Form doesn't control your entire form and inputs, which is the...
Read more >Cannot read property 'value' of null" error message while ...
Cause. Kingston introduced a new form object for service catalog items and tasks. However, we have seen a few issues with variables when...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
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
Damn!!! Sorry. Thanks v much for looking into this so quick
no worries, however, I did find an improvement so it’s not all for nothing. 👍