You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm trying to reset field value when the input stops being displayed.
It looks like this
useEffect(() => { if (isOnline) { clearErrors('event_city'); clearErrors('places'); resetField('event_city'); resetField('places'); } }, [isOnline]);
But if I try to reset the field after an UNSUCCESSFUL submission, I get this error:
Cannot assign to read only property 'value' of object '#<Object>'
or this
Cannot add property value, object is not extensible
This is my useForm hook

DefaultValues for these fields

And zod schema for these fields

Beta Was this translation helpful? Give feedback.
All reactions