diff --git a/src/useField.tsx b/src/useField.tsx index 2eec18c..4698065 100644 --- a/src/useField.tsx +++ b/src/useField.tsx @@ -54,8 +54,8 @@ const updateFieldState = ( let nextState = state; const focused = formState.focusedPath === formattedPath; - const visited = !!get(formState.visitedMap, parsedPath); - const touched = !!get(formState.touchedMap, parsedPath); + const visited = !!get(formState.visitedMap, [formattedPath]); + const touched = !!get(formState.touchedMap, [formattedPath]); const value = get(formState.values, parsedPath) as FV; const pendingValue = get(formState.pendingValues, parsedPath) as FV; diff --git a/src/useFieldStatus.tsx b/src/useFieldStatus.tsx index 942ef30..975e7e5 100644 --- a/src/useFieldStatus.tsx +++ b/src/useFieldStatus.tsx @@ -28,8 +28,8 @@ export const updateFieldStatus = ( let nextState = state; const focused = formState.focusedPath === formattedPath; - const visited = !!get(formState.visitedMap, parsedPath); - const touched = !!get(formState.touchedMap, parsedPath); + const visited = !!get(formState.visitedMap, [formattedPath]); + const touched = !!get(formState.touchedMap, [formattedPath]); const value = get(formState.values, parsedPath) as FV; const pendingValue = get(formState.pendingValues, parsedPath) as FV;