@bombillazo/rhf-plus 7.56.3-plus.1 → 7.56.3-plus.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -357,7 +357,10 @@ function useWatch(props) {
357
357
  */
358
358
  function useController(props) {
359
359
  const methods = useFormContext();
360
- const { name, disabled, control = methods.control, shouldUnregister } = props;
360
+ const { name, disabled, control = methods === null || methods === void 0 ? void 0 : methods.control, shouldUnregister, } = props;
361
+ if (!control) {
362
+ throw new Error('useController: missing `control`. Pass `control` as a prop or provide it via FormProvider.');
363
+ }
361
364
  const isArrayField = isNameInFieldArray(control._names.array, name);
362
365
  const value = useWatch({
363
366
  control,