-
Notifications
You must be signed in to change notification settings - Fork 6
2.2 NestedFields
Avram Walden edited this page May 2, 2024
·
5 revisions
Provides context for nesting inputs.
const user = {
firstName: 'Finn',
preferences: {
princess: 'Bubblegum',
sword: 'Scarlet'
}
}
const PageWithFormOnIt = () => {
return (
<Form model="user" data={ { user } } to={ `users/${user.id}` } method="patch">
<TextInput name="firstName" label="First Name" />
<NestedFields model="preferences">
<TextInput name="princess" label="Favorite Princess" />
<TextInput name="sword" label="Favorite Sword" />
</NestedFields>
</Form>
)
}