T
TanStack2y ago
multiple-amethyst

Is it possible to do nested arrays with multiple `mode="array"`?

At the moment to achieve the wanted behavior I need to remove the nested mode="array" which again later on ruin some type safety when trying to use ex handleChange. What I currently need to do is:
onValueChange={(value) =>
handleChange(value as never)
}
onValueChange={(value) =>
handleChange(value as never)
}
2 Replies
passive-yellow
passive-yellow2y ago
Can you share a more complete code sample? It's absolutely possible to do what you're asking
ambitious-aqua
ambitious-aqua2y ago
I think I'm having the same problem, it's similar to this one https://github.com/TanStack/form/issues/625 but with one more nesting level. That linked issue was when your array is at foo.bar[i].name and it now works, but if you're already inside an array as foo.bar[i].baz[j].name then again you get an error on the hancleChange Argument of type 'string' is not assignable to parameter of type 'UpdaterFn<never, never>' (in this case name is a string)

Did you find this page helpful?