I working with yup validation and trying to build a conditional validation object
Normally, I use Field in redux form to handle form input value and validation it with yup, but In another case, I use FieldArray to implement complicate condition, this is a code I use FieldArray:
<form onSubmit={handleSubmit}>
<FieldArray
name="session"
component={RenderSession}
/>
</form>
this is component I bind in FieldsArray,
export const RenderSession = ({ fields }) => {return (
{fields.map((member, index) => (
<div key={index}>
<Field
name={`${member}.name`}
validate={validateProps}
/>
</div>
<Button onClick={() => fields.push({})}>
Add
</Button>
</Row>
</>
I want to check validations the value of the field name = {$ {member} .startTime} how to use yup
Please give me a solution for using yup with FieldsArray or anything else. In the case of this impossible, teach me to have another way,
Feel free to question,
Thanks