vendredi 16 juillet 2021

TERNARY CONDITIONAL OPERATOR does not work as expected [duplicate]

i have this ternary:

{item?.orderItemStatus?.name === ('PROCESSED' || 'IN_TRANSIT') ? (
            <ReturnItemButton orderItem={item} />
          ) : null} 

but it only seems to work for PROCESSED. If i change the status to IN_TRANSIT it returns the null.

Why?

Aucun commentaire:

Enregistrer un commentaire