Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

FormSection.tsx

22 lines575 Bytes

1import { StringField } from './StringField'
2import type { ReactFormType } from '@tanstack/react-form'
3import type { sharedFormOptions } from './sharedForm'
4​
5interface FormSectionProps {
6 form: ReactFormType<typeof sharedFormOptions>
7}
8​
9export function FormSection(props: FormSectionProps) {
10 const { form } = props
11​
12 return (
13 <>
14 <form.Field name="address.street">
15 {(field) => <StringField field={field} />}
16 </form.Field>
17 <form.Field name="address.country">
18 {(field) => <StringField field={field} />}
19 </form.Field>
20 </>
21 )