React 与运算符 && 多层级的条件判断

图片说明
{ type == 0 &&


礼金价: ¥
{ item.welfare_price }

}
{ (type == 0 && item.publicCoupons != null) &&

¥{ item.publicCoupons.price }

}
{ (type == 0 && item.per_face != null) &&

预估
淘礼金¥{ item.per_face }

}
请问这种情况如何简化 不想重复判断type字段

{type == 0 && (
<>


礼金价:¥
{item.selfare_price}

{Item.publicCoupons !==null && (

)}
{Item.per_face && (

)}
</>
)}

图片说明

https://blog.csdn.net/u012149969/article/details/82314197

如果只是改变价格显示,直接用三元运算就可以了