I am using reactJS and I would like to hide a div on smaller screen (width<768px). I have two options here:
First Method:
{
!!isSmallerScreen ?
<div className="icon">Icon</div>
: <div className="name">Name</div>
}
Description: isSmallScreen
is a boolean variable. This way will not even show other div in source code.
Second Method:
<div className="icon hidden-md-up">Icon</div>
<div className="name hidden-sm-down">Name</div>
Description: I'm using twiitter bootstrap here which will add display: none
on other div.
P.s. I know bootstrap is also using javascript but my question is which approach is better to use? Infact I am confused whether to use bootstrap
or not as I'm already using css3 flexbox system
with postcss
and cssnext
.
Your suggestions will be highly appreciated. Thanks for your time in advance.