I have a text field area. Users can add extra fields. I can take all values from these fields and put them into a single array. But I don't want to send to backend empty string. I am using YUP as a validation
For instance;
Field 1 = "hi"
Field 2 = "how"
Field 3 = ""
const myArray = ["hi","how",""]
to be sent = ["hi","how"]
If I have only one item like
Field 1 = ""
I want to say = "this field can not be blank"
What I did
array()
.compact(v => Boolean(v) !== true)
.required("Can not be blank"),