Skip to content

Commit 35827d7

Browse files
committed
fix: rename property
1 parent fdbb145 commit 35827d7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/form/Form.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ type BaseFormProps<Values> = Omit<FormikConfig<Values>, "children"> & {
5656
children: ReactNode | ((props: _FormikProps<Values>) => ReactNode)
5757
scrollIntoViewOptions?: ScrollIntoViewOptions
5858
nonFieldErrorsProps?: Omit<NonFieldErrorsProps, "children">
59-
order?: Array<{ name: string; inputRef: RefObject<HTMLInputElement> }>
59+
fieldRefs?: Array<{ name: string; inputRef: RefObject<HTMLInputElement> }>
6060
}
6161

6262
const BaseForm = <Values extends FormValues>({
6363
children,
6464
scrollIntoViewOptions = SCROLL_INTO_VIEW_OPTIONS,
6565
nonFieldErrorsProps,
66-
order,
66+
fieldRefs,
6767
...otherFormikProps
6868
}: BaseFormProps<Values>) => (
6969
<Formik {...otherFormikProps}>
@@ -79,10 +79,10 @@ const BaseForm = <Values extends FormValues>({
7979
)
8080
}
8181
// If a submission was attempted and refs to the fields were provided.
82-
else if (formik.isSubmitting && order && order.length) {
82+
else if (formik.isSubmitting && fieldRefs && fieldRefs.length) {
8383
const errorNames = getKeyPaths(formik.errors)
8484

85-
const inputRef = order.find(({ name }) =>
85+
const inputRef = fieldRefs.find(({ name }) =>
8686
errorNames.includes(name),
8787
)?.inputRef
8888

0 commit comments

Comments
 (0)