Why is it that in Nextjs 14 (ReactJS 18), when I conditionally assign css
classes within a jsx
code like this:
<Swiper
className={lightbox ?
"swiperLightbox h-[80%] md:h-[70vh] z-50" :
"swiperMain h-[21vmax] rounded-xl"}
>
the element has both classes swiperMain
and swiperLightbox
correctly when the lightbox
condition is true
, along with the other Tailwind classes?
And when the lightbox
condition is false
, it only includes the swiperMain
class and the Tailwind classes as expected.