Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Show and Hide element in react

return(
  <nav className="nav__bar">
    <ul className="menu">
      <li className="menu__icon" onClick={() => setShow(currentShow => !currentShow)}>
        <box-icon name='menu' color="floralwhite" size="md"/>
        { show ? <Curtain/> : null }
      </li>
    </ul>
  </nav>
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Show #Hide #element #react
ADD COMMENT
Topic
Name
3+3 =