question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Watched inputs with `null` value cause TypeError

See original GitHub issue

Describe the bug Watching an input component with a null default value causes an TypeError in utils/getPath

To Reproduce Steps to reproduce the behavior:

  1. Go to ‘https://codesandbox.io/s/react-hook-form-useform-template-28yig?file=/src/index.js
  2. Click on ‘Submit’
  3. 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:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:19 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
pixel-mattpcommented, Jul 17, 2020

Damn!!! Sorry. Thanks v much for looking into this so quick

0reactions
bluebill1049commented, Jul 17, 2020

no worries, however, I did find an improvement so it’s not all for nothing. 👍

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found