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

React - CSS class conditional of CSS class example

0 votes
10 views
added Apr 20 in React by lcjr Second Warrant Officer (5,360 points)
edited Apr 21 by LC Marshal
let carBadge = 'car badge';
  if (isLr && isJlr) {
    carBadge  = 'car badge-lr';
  }
  if (isBmw) {
    carBadge  = 'car badge-bmw';
  } else {
    carBadge = 'car badge';
  }

return (
  <>
    <div
      className={carBadge}
      onMouseEnter={e => setHover(e, listingItemData)}
      onMouseLeave={e => unsetHover(e)}
  >

 

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.
...