React Hook Form: Validation not triggering on nested object updates
I need some guidance on I'm writing unit tests and I'm using React Hook Form v7 to manage my forms, but I'm working with an scenario with validation not triggering when I update fields in a nested object..... My form schema includes a user object with nested fields for `address`. I expect validation to occur when I modify any nested field, but it only seems to validate when I change top-level fields. Hereโs a simplified version of my form setup: ```javascript import React from 'react'; import { useForm, Controller } from 'react-hook-form'; const MyForm = () => { const { handleSubmit, control, setValue, formState: { errors } } = useForm(); const onSubmit = (data) => { console.log(data); }; return ( <form onSubmit={handleSubmit(onSubmit)}> <Controller name="user.name" control={control} rules={{ required: 'Name is required' }} render={({ field }) => <input {...field} />} /> {errors.user?.name && <p>{errors.user.name.message}</p>} <Controller name="user.address.street" control={control} rules={{ required: 'Street address is required' }} render={({ field }) => <input {...field} />} /> {errors.user?.address?.street && <p>{errors.user.address.street.message}</p>} <button type="submit">Submit</button> </form> ); }; ``` I've tried explicitly calling `setValue` after updating nested fields, but the validation still doesn't trigger as expected. For instance, if I update `user.address.street` with a new value, I would expect to see the validation message if itโs empty, but it seems like the validation only checks when the input loses focus or when the top-level form is submitted. Iโve also checked that Iโm using the latest version of React Hook Form (7.0.0) and React (17.0.2). Is there a way to ensure that nested validations are triggered immediately as the user types, or am I missing something in the configuration? Any insights would be appreciated! What am I doing wrong? This is part of a larger mobile app I'm building. Am I approaching this the right way? This is for a web app running on Debian. Is this even possible? I'm working with Javascript in a Docker container on Ubuntu 22.04. I'd really appreciate any guidance on this.