React condition - if string value of variable == 'this', do this

0 votes
79 views
added Aug 19, 2021 in React by lcjr First Warrant Officer (9,190 points)
<!--Originally show this-->
<span>{agentID}</span> */}


<!--if string value of variable == 'hide me', shows 'none'-->
<span>{(agentID==='hide me') ? "none" : agentID }</span>

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...