In React Hook form, can't reset nested object
I'm trying to reset otherSuppliers when buyFromOtherSuppliers is false.
2 Replies
Here is the full error message of line 89 Argument of type '{ commercialInformation: any; "": any; null: any; }' is not assignable to parameter of type 'AssertsShape<{ id: NumberSchema<number | null | undefined, AnyObject, number | null | undefined>; accountType: StringSchema<string | undefined, AnyObject, string | undefined>; activeStep: NumberSchema<...>; customerIdentification: OptionalObjectSchema<...>; customerContacts: OptionalObjectSchema<...>; commercialInfo...'.
Object literal may only specify known properties, and '(Missing)' does not exist in type 'AssertsShape<{ id: NumberSchema<number | null | undefined, AnyObject, number | null | undefined>; accountType: StringSchema<string | undefined, AnyObject, string | undefined>; activeStep: NumberSchema<...>; customerIdentification: OptionalObjectSchema<...>; customerContacts: OptionalObjectSchema<...>; commercialInfo...'.