Skip to content
Source
Sign inSign up
TanStack/form

Allow optional arrays to have array methods #1588

OpenMPiland(GitHub profile, opens in a new tab) opened this issue 0 comments

Much of my data is optional as I'm building a content creation form for TTRPG systems. This is a fairly complex form and there's a lot of variety even within a group of what's actually required. And rather than filling in empty arrays automatically to just have to disregard them when the data is submitted, I leave them optional. As of right now, when trying to use the removeFieldValue method, it will types the optional field as never.

A work around is to a copy of the array with the value removed and then using setFieldValue.

  1. LeCarbonator(GitHub profile, opens in a new tab) added labelstype: enhancement

Sign in to join this conversation.