Best way to subscribe/react to field value change after form.update
?
#1043
-
I want to react to field value change after I do form.update({
name: fields.something.name,
value: '....',
})
What's the proper way? |
Beta Was this translation helpful? Give feedback.
Answered by
edmundhung
Sep 23, 2025
Replies: 1 comment 1 reply
-
Hmmm, I am not sure what you are running into, but But we do plan to remove it in v2, so a future proof solution would be using the new import { useFormData } from '@conform-to/react/future';
const value = useFormData(formRef, formData => formData?.get(fields.something.name)); The form ref could be the form id or a react ref of any form related elements. See the docs for more details. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
vsnig
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hmmm, I am not sure what you are running into, but
fields.something.value
is reactive and should reflect with the latest value.But we do plan to remove it in v2, so a future proof solution would be using the new
useFormData
hook:The form ref could be the form id or a react ref of any form related elements. See the docs for more details.