I am trying to display a div according to some condition but it is not working properly.
i have some user like admin and visitor and some more profile, and there is one more condition associated with admin let take that condition isBusy(boolean).
i want to display particular div only for admin and visitor. and for admin when isBusy is true
here is my code-
{(user.isAdmin() && this.props.isBusy) || user.isVisitor() &&
<div>
some more code
</div>
}
i want to show this div when user is admin and isBusy = true or user is visitor.
these conditions are not working properly.
Thanks in advance
question from:
https://stackoverflow.com/questions/65951647/how-to-display-a-div-with-multiple-conditions-in-reactjs 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…