Open
Description
Would be good to have ability to compose set of fields to different forms that have same common field using typescript.
react-hook-form
already has such functionality via Lenses: https://github.com/react-hook-form/lenses
Original feature request which ended up by creating lenses for react-hook-form
: https://github.com/orgs/react-hook-form/discussions/7354
Overview
Imagine this structure of forms:
interface Address {
street: string
houseNumber: number
city: string
country: string
}
interface Person {
name: string
address: Address
}
interface Order {
item: string
shippingAddress: Address
}
I wanna create component to display Address
part of any form.
So that in other forms(like Order
and Person
and many more which will have address field structure) I can declaratively reuse Address
fields by just providing basePath to them and having correct typescript validation and typings.
Metadata
Metadata
Assignees
Labels
No labels