Are you first timer at 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
added Jul 22 in React by lcjr Second Warrant Officer (6,120 points)
    background-image: url('/images/current-listings/bed.png');
  //Combine variable and HTML text
  {beds === 0 ? <>Studio</> : <>{`${beds} beds`} </>}
  //variable only 
  {beds === 0 ? <>Studio</> : <>{beds} </>}


Please log in or register to response this reference. - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.