vendredi 18 décembre 2020

Conditional statement inside JSX in react native?

I want to set my state inside JSX expression and show my component if the condition is true. How can i achieve that? my code is :

{(currenMonth !== item.orderDate)
                && (setCurrentMonth(item.orderDate) && <Item name={getMonthFromString(item.orderDate)} active />)
              }

Aucun commentaire:

Enregistrer un commentaire