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.

Uncontrolled components wrapped with Controller doesn't fire validation errors

See original GitHub issue

Describe the bug When wrapping components with Controller and sending props to it by render validation errors won’t be fired.

To Reproduce Steps to reproduce the behavior:

  1. create a form with a component managed by Controller and rule required
  2. submit form

Codesandbox link (Required) https://codesandbox.io/s/react-hook-form-v6-clearerrors-m1ky0?file=/src/index.jsx

Expected behavior The validation errors should be fired also for components wrapped in Controller

Desktop (please complete the following information):

  • OS: Windows 10 Pro 1909
  • Browser: Brave
  • Version: 1.10.97

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
bluebill1049commented, Jul 16, 2020

it’s correct. 👍

0reactions
giovanicascaescommented, Jul 16, 2020

Sorry. I guess I’ve been too quick in reviewing the sandbox. Triple checked this time, it is working as expected. Just let me know if onChange is the right place to place trigger.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Show Error From Controllers in React Hook Forms
I am trying to throw required errors from my input which I have wrapped in a Controller component from react-hook-form version 7.
Read more >
React Hook Form Handling Basics: Uncontrolled and ... - Able
A short post on what is Uncontrolled and Controlled components. How we use them with React hooks for form handling? Why and when...
Read more >
React Hook Form Validation with Complete Examples | refine
We'll implement React Hook Form custom validations and schema ... Next, we'll wrap the <TextField> components with the Controller component:.
Read more >
React Hook Form for React Native - Echobind
Sep 09, 2021 | This blog post will help guide utilizing React Hook Form to register form inputs on the component level via...
Read more >
Advanced Usage - React Hook Form
React Hook Form has support for native form validation, which lets you ... React Hook Form embraces uncontrolled components and is also compatible...
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