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

FormSection.tsx

20 lines604 Bytes

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