lundi 21 décembre 2020

How to check more than one value inside the if else condition in react js? [duplicate]

I have something like this,

    <div label="Account Information">
      if ((editAccount === false )&& (changePassword === false) )
      {<AccountInformation></AccountInformation>}
      else if((editAccount === false) && (changePassword === true))
      {<ChangePassword></ChangePassword>}
      else{""}
    </div>

Now I want to render the component interms of the following condition, but I am not able to do this. Why if else does not work here?
I also tried using conditional rendering using logical operator but in my case, I have to check two values, editAccount and changePassword.
How would I do that?

Aucun commentaire:

Enregistrer un commentaire