VoliJS / NestedLink

Callback-free React forms with painless validation.
MIT License
194 stars 25 forks source link

Question: how to link a property which is an array of objects #36

Closed avkonst closed 5 years ago

avkonst commented 6 years ago

I have got the state like the following:

state = {
    places: {
        name: string,
        nearByPOI: {
             name: string,
             location: {
                 latitude: number,
                 longitude: number
             }
        }[] 
    }[]
}

I wonder how to link, for example to state->places->nearByPOI->name properties?

gaperton commented 5 years ago

Literally in the same way you mentioned it.

const link = this.linkAt('places').at('nearByPOI').at('name);