-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Closed
Description
Version Number
7.66.0
Codesandbox/Expo snack
https://codesandbox.io/p/devbox/goofy-grothendieck-lg2sz9
Steps to reproduce
- Create a form using useForm with the values prop (controlled mode)
- Initially set values to undefined or an incomplete object
- Asynchronously load data and update the values prop with complete, valid data
- Observe that formState.isValid doesn't update automatically
Workaround
Currently, we need to manually trigger validation in a useEffect when the values prop changes:
useEffect(() => {
if (formValues) {
void form.trigger();
}
}, [form, formValues]);
Expected behaviour
When the values prop changes (e.g., when data is loaded asynchronously), the form should automatically revalidate and update formState.isValid accordingly, without requiring manual intervention.
Please note that this used to work up until v7.65.0, it seems as if this regression was introduced with v7.66.0.
Code of Conduct
- I agree to follow this project's Code of Conduct
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels