Are you first timer at lazacode.org? Why not join us and start exchange your programming knowledge with everyone. Register today!

React - conditional rendering for show and hide when element is present

0 votes
22 views
added Jul 22 in React by lcjr Second Warrant Officer (6,120 points)
<span
  css={css`
    background-image: url('/images/current-listings/bed.png');
  `}
>
  //Combine variable and HTML text
  {beds === 0 ? <>Studio</> : <>{`${beds} beds`} </>}
  
  //variable only 
  {beds === 0 ? <>Studio</> : <>{beds} </>}
</span>

 

Please log in or register to response this reference.

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