I'm following this example for dependent fields https://formik.org/docs/examples/dependent-fields
At this point
const {
values: { taxRefundAmount },
setFieldValue,
} = useFormikContext()
I want to destructure values based on a certain condition like this for example
const {
values: { props.name === 'taxRefundVATAmount' ? taxRefundAmount : taxChargeAmount },
setFieldValue,
} = useFormikContext()
Of course, this throws an error. Is this even possible?
Via Active questions tagged javascript - Stack Overflow https://ift.tt/7ZWEbgv
Comments
Post a Comment