Uncontrolled components wrapped with Controller doesn't fire validation errors
See original GitHub issueDescribe 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:
- create a form with a component managed by
Controller
and rulerequired
- 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:
- Created 3 years ago
- Comments:13 (8 by maintainers)
Top 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 >
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
it’s correct. 👍
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 placetrigger
.