@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.
- package/README.md +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +4 -1
- package/dist/index.esm.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/useController.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.mjs
CHANGED
|
@@ -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,
|