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.

ErrorMessage renders nothing unless an explicit error message is set

See original GitHub issue

Describe the bug ErrorMessage doesn’t display anything when validation fails and no explicit error message has been set.

To Reproduce

<input name="singleErrorInput" ref={register({ required: true })} />
<ErrorMessage errors={errors} name="singleErrorInput" as="p" />

Codesandbox link Edit React Hook Form - ErrorMessage

Expected behavior I expect the component to be rendered with a default error message instead of nothing.

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context If this is intended behavior, consider updating the documentation to describe this, because I had to debug the code in the browser to realize what the actual problem was.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
bluebill1049commented, Jan 25, 2020

i am going to close this issue, as next release will have this feature above.

2reactions
bluebill1049commented, Jan 27, 2020

no worries @kotarella1110 🙏

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error thrown - Warning: You called act(async () => ...) without ...
The test seems to work fine (passes as written, fails if I change expected values), but I still see the console.error message warning ......
Read more >
Stripe API reference – Errors – curl
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries....
Read more >
3 of the Most Common Errors in React - Netlify
The quick fix is to be more explicit when set the response data to variables on state.
Read more >
Proposed Error message describes invalid form field value
Description. This rule checks that text error messages provided when the user completes a form field with invalid values or using an invalid...
Read more >
Error Messages - SQLAlchemy 1.4 Documentation
This error is a DBAPI Error and originates from the database driver (DBAPI), not SQLAlchemy itself.
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