Feature request: support synchronous validation
See original GitHub issueWe are using yup along with react-hook-form, and almost all of our schemata support synchronous validation. Unfortunately, there’s no way to use schema.validateSync
instead of schema.validate
through the resolver.
While the performance impact of this is negligible, inserting an event loop between form submission and handleSubmit
being called adds an unnecessary layer of complexity to our tests.
It would be great if we could pass an option to validate the schema synchronously. Better yet, if the resolver attempted to validate synchronously and fell back on asynchronous validation if required.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
Synchronous Record Validation - Salesforce Developers
Quickly validate your payloads synchronously in development mode before you commit records to the lake. This method provides synchronous validation of object ...
Read more >Synchronous and asynchronous input validation with ag-Grid
Synchronous validation is used for simple validation logic that is performed on the client without a remote service call. Please see the details ......
Read more >Custom validations - Customer Fields for Developers
Here's how you add a custom validation to one of our forms: ... If your comparator is asynchronous (if it returns a Promise,)...
Read more >Asynchronous Request-Reply pattern - Azure - Microsoft Learn
Solution · The client application makes a synchronous call to the API, triggering a long-running operation on the backend. · The API responds...
Read more >Json schema for validation in sync function - Couchbase Forums
Can I make a feature request for a new function to be added to the sync ... This would make full validation of...
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
Hi @Smona 👋🏻
FIY Yup sync validation added in the v2.0.0-beta.5 You can try it by installing
yarn add @hookform/resolvers@v2.0.0-beta.5
@jorisre hey, awesome! Thanks for taking this on