T
TanStack2y ago
adverse-sapphire

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
fascinating-indigo
fascinating-indigo2y ago
✨ Nothing ✨ (no, really)
adverse-sapphire
adverse-sapphireOP2y 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?