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

0 votes
157 views
added Aug 19, 2021 in React by lcjr First Warrant Officer (11,830 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.
...