react-hook-form 7.66.1 → 7.67.0
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/dist/index.cjs.js +1 -1
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.mjs +3 -3
- 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/types/controller.d.ts +2 -1
- package/dist/types/controller.d.ts.map +1 -1
- package/dist/types/path/eager.d.ts +1 -1
- package/dist/types/path/eager.d.ts.map +1 -1
- package/dist/useController.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.mjs
CHANGED
|
@@ -443,19 +443,19 @@ function useWatch(props) {
|
|
|
443
443
|
*/
|
|
444
444
|
function useController(props) {
|
|
445
445
|
const methods = useFormContext();
|
|
446
|
-
const { name, disabled, control = methods.control, shouldUnregister, defaultValue, } = props;
|
|
446
|
+
const { name, disabled, control = methods.control, shouldUnregister, defaultValue, exact = true, } = props;
|
|
447
447
|
const isArrayField = isNameInFieldArray(control._names.array, name);
|
|
448
448
|
const defaultValueMemo = React.useMemo(() => get(control._formValues, name, get(control._defaultValues, name, defaultValue)), [control, name, defaultValue]);
|
|
449
449
|
const value = useWatch({
|
|
450
450
|
control,
|
|
451
451
|
name,
|
|
452
452
|
defaultValue: defaultValueMemo,
|
|
453
|
-
exact
|
|
453
|
+
exact,
|
|
454
454
|
});
|
|
455
455
|
const formState = useFormState({
|
|
456
456
|
control,
|
|
457
457
|
name,
|
|
458
|
-
exact
|
|
458
|
+
exact,
|
|
459
459
|
});
|
|
460
460
|
const _props = React.useRef(props);
|
|
461
461
|
const _previousNameRef = React.useRef(undefined);
|