0

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?

1 Answer 1

1

is the operator && valid to concatenate 2 conditions?

Yes.

Also your formatting is correct 🌹

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.