You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, we do support Field Arrays, but their usage is not clear and I have low confidence as a maintainer that we won't break them in the future. Let's update docs and tests for field arrays so that we're able to ship this more confidently.
Activity
Christian24 commentedon Oct 30, 2023
I just tested this in my prototype. How is the API meant to work? I just iterated over the array and built the field name with the index aka
This seems to work fine, but
DeepKeysdoes not support it. Is this how you envision the API for FieldArrays though, @crutchcorn?Btw my updated prototype is here: https://github.com/Christian24/tanstack-form-lit-prototype/tree/arrays
Christian24 commentedon Oct 31, 2023
Upon further investigation it seems correct names look as follows:
This works and types also work for this.
Christian24 commentedon Nov 1, 2023
Interestingly, there seems to be some documentation on the website already: https://tanstack.com/form/latest/docs/guides/basic-concepts#array-fields
I did do a quick find usages on index though and Webstorm said it was used nowhere. So, I have no idea if these examples are correct.
Christian24 commentedon Nov 2, 2023
There are also already tests present, so maybe this can be closed @crutchcorn
crutchcorn commentedon Nov 3, 2023
Yea this deffo can be closed, my bad