Skip to content
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

useFieldValidator hook not working as expected #290

Open
AlexShukel opened this issue Aug 27, 2023 · 1 comment
Open

useFieldValidator hook not working as expected #290

AlexShukel opened this issue Aug 27, 2023 · 1 comment
Assignees
Labels
bug Something isn't working feature New feature or request

Comments

@AlexShukel
Copy link
Collaborator

Describe the bug
Now useFieldValidator hook does not re-run validator function when reference to it changes. In addition, it does not call validator function on first render.

Expected behavior
It is expected that validator function will be called each time reference to it changes.

Additional context
In addition, we must decide if bindings to yup are necessary. Maybe it is better to get rid of this dependency.

@AlexShukel AlexShukel added bug Something isn't working feature New feature or request labels Aug 27, 2023
@AlexShukel AlexShukel self-assigned this Aug 27, 2023
@AlexShukel
Copy link
Collaborator Author

AlexShukel commented Aug 28, 2023

Things to remember after migrating to new useFieldValidator

  • All utility hooks (useIntegerField, etc...) must be refactored to retain stable reference on validate function that is being passed to useFieldValidator.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant