T
TanStack16mo ago
grumpy-cyan

What is mode="array" doing?

I noticed I forgot it on a couple of form.Field with arrays, but everything seems to be working so the question, what is it actually doing?
2 Replies
correct-apricot
correct-apricot16mo ago
✨ Nothing ✨ (no, really)
grumpy-cyan
grumpy-cyanOP16mo ago
Ok, I suspected that 😂 The only usage I found is this inside useField, but I don't get it 😅
useStore(
fieldApi.store,
opts.mode === 'array'
? (state) => {
return [state.meta, Object.keys(state.value as never).length]
}
: undefined,
)
useStore(
fieldApi.store,
opts.mode === 'array'
? (state) => {
return [state.meta, Object.keys(state.value as never).length]
}
: undefined,
)

Did you find this page helpful?