+ {values.units && values.units.length > 0 ? (
+ values.units.map((unit, index) => (
+
+ {/*
*/}
+
+ setFieldValue(
+ `units.${index}`,
+ isNaN(parseInt(e.target.value))
+ ? 0
+ : parseInt(e.target.value),
+ )
+ }
+ />
+
+
}
+ onClick={() => arrayHelpers.remove(index)} // remove a friend from the list
+ >
+ Delete
+
+
+
+
+ ))
+ ) : (
+
+ )}
+ {errors.units && (
+
{errors.units as string}
+ )}
+
+
+
+
+
+ )}
+ />
+