#form.watch doesn't get fired with useFormProvider
4 messages · Page 1 of 1 (latest)
I'll appreciate any hint to debug the problem
Ok, I've found the problem:
form.watch doesn't work with form.insertListItem, but It works if I use form.setFieldValue
Both behavior can be check here: https://codesandbox.io/p/sandbox/mantine-react-template-forked-463wtc
I can see the setFieldValue implements subscribers:
https://github.com/mantinedev/mantine/blob/00a94ceefc22c80ad08af73acb943f8f0c01d662/packages/%40mantine/form/src/hooks/use-form-values/use-form-values.ts#L79-L97
But not in insertListItem https://github.com/mantinedev/mantine/blob/00a94ceefc22c80ad08af73acb943f8f0c01d662/packages/%40mantine/form/src/hooks/use-form-list/use-form-list.ts#L38-L45