Reputation: 16138
I have a conditional for styling that works with only one condition:
<View
style={[
message.sender.isSystem && styles.systemMessageLine,
message.data.mine && styles.yourMessageLine,
]}
>
Now if I want to have 2 conditionals how will I format that?
<View
style={[
(!message.data.mine && !message.sender.isSystem) && styles.thirdPartyMessage
]}
>
is the operator
&&
valid to concatenate 2 conditions?
Upvotes: 0
Views: 396
Reputation: 275927
is the operator
&&
valid to concatenate 2 conditions?
Yes.
Also your formatting is correct 🌹
Upvotes: 1