-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[@mantine/form] add asyncResolver on use-form #1255
[@mantine/form] add asyncResolver on use-form #1255
Conversation
…into feature/async-validation-use-form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently, I do not really like what I'm seeing, async api feels very strange and unintuitive.
@@ -0,0 +1,97 @@ | |||
import { renderHook, act } from '@testing-library/react-hooks'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All tests files should be in tests folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's test helper async version of src/mantine-form/src/resolvers/test-resolver.ts
yeah I feel same. but if can need support it right. actually if #1100 |
Alright, I think this issue will require more investigation before it can be merged, getting the api right for these use cases seems to be tricky |
@rtivital I think the approach can be similar like this.
|
#1100
to check promise need call function ex schema(null) I think there will be performance loss on other resolver ex: yup, zoi. so I decided just use asyncResolver props.
my suggest to make not bigger code should split between async and sync so no hidden bug will occur.
the schema types depend on many place. so I can't change to use Promise. for now I just bypass it by any when init useForm