I'm having a problem on how to make the reason get disappear if API data for reason is N/A. Currently I'm using the below code and it is not working. Please do help me out.
{invoiceInfo.reason !== N/A ? (
<Text style={[GlobalStyle.ReceiptDeclinedReason]}>Reason: {invoiceInfo.reason}</Text>
) : N/A}
API Data:
CodePudding user response:
change to:
{invoiceInfo.reason !== "N/A" ? (
<Text style={[GlobalStyle.ReceiptDeclinedReason]}>Reason: {invoiceInfo.reason}</Text>
) : <></>}