Closed pheuter closed 2 years ago
unfortunately it's not possible currently and we haven't thought of a good way to make it
buuut what we've been doing for is to treat nested data as nested forms, so we create a new "ReForm instance" for every
module AddressState = %lenses(
type state = {
line1: string,
line2: option<string>,
zip: int,
}
)
module FormFields = %lenses(
type state = {
name: string,
email: string,
address: AddressState.state,
}
)
Thanks for the suggestion, makes sense.
Can we close? @fakenickels
Is it possible for lenses to support nested records? It doesn't seem like it's possible to make it work with reform:
Is this even a valid way to think about the use case? Should all form fields be top-level by design? Any guidance or feedback appreciated.