Skip to content

Commit

Permalink
add suppressError to useFormField
Browse files Browse the repository at this point in the history
  • Loading branch information
JDMathew committed Jul 16, 2024
1 parent f86313a commit e8213e2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/forms/src/hooks/useFormField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type UseFormField = {
hasValidation: boolean;
hasError?: boolean;
errorMessage?: string;
suppressError?: boolean;
};

export const useFormField = ({
Expand All @@ -30,9 +31,10 @@ export const useFormField = ({
accessibilityHint,
errorMessage,
editable = true,
suppressError,
style = {},
}: UseFormField) => {
const { refs, submitForm, focusField } = useForm();
const { refs, submitForm, focusField } = useForm({ suppressError });
const fieldRef = React.useRef(ref);

const checks = __DEV__ ? useChecks?.() : undefined;
Expand Down

0 comments on commit e8213e2

Please sign in to comment.