I'm having trouble understanding Formik and conditionally rendering some of the items Like to conditionally render an initial value in formik keep telling me that image is undefined when in the if statement
<Formik
enableReinitialize={true}
initialValues={{
name: currentBankData.name || '',
address: currentBankData.address || '',
country: currentBankData.country || '',
region: currentBankData.region || '',
city: currentBankData.city || '',
swiftCode: currentBankData.swiftCode || '',
routeCode: currentBankData.routeCode || '',
image: currentBankData.image || ''
/*Something Like this
baniId ? (
image: currentBankData.image || ''
) : ("")
*/
}
}
Is this what you mean? If
baniId
thencurrentBankData.image
otherwise''