Skip to content

Commit d94e667

Browse files
committed
RruForm: fixed console error message regarding field name containing digit
1 parent 30c335b commit d94e667

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/form/hooks/useField.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const useField = (name: string, onProgrammaticValue?: (serializedValue: a
2929
const [isTouched, setIsTouched] = useState<boolean>(false);
3030
const watchResult = useWatch({ name: name });
3131

32-
if (name && name.split('.').filter((p) => /\d+/.test(p)).length > 0) {
32+
if (name && name.split('.').filter((p) => /^\d+$/.test(p)).length > 0) {
3333
console.error(
3434
`Field name "${name}" cannot include a numeric part. Try to prefix the numeric part with some string.`
3535
);

0 commit comments

Comments
 (0)