Skip to content

Commit 18f3c1c

Browse files
committed
fix: only show value proxy warning if the value is an object
1 parent ab9610f commit 18f3c1c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/vee-validate/src/useField.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import {
4444
lazyToRef,
4545
unravel,
4646
} from './utils';
47-
import { isCallable } from '../../shared';
47+
import { isCallable, isObject } from '../../shared';
4848
import { FieldContextKey, FormContextKey, IS_ABSENT } from './symbols';
4949
import { useFieldState } from './useFieldState';
5050
import { refreshInspector, registerSingleFieldWithDevtools } from './devtools';
@@ -284,6 +284,10 @@ function _useField<TValue = unknown>(
284284
watch(
285285
valueProxy,
286286
(value, oldValue) => {
287+
if (!isObject(value)) {
288+
return;
289+
}
290+
287291
if (value === oldValue && isEqual(value, oldValue)) {
288292
warn(
289293
'Detected a possible deep change on field `value` ref, for nested changes please either set the entire ref value or use `setValue` or `handleChange`.'

0 commit comments

Comments
 (0)