adrianhajdin / project_3D_developer_portfolio

The most impressive websites in the world use 3D graphics and animations to bring their content to life. Learn how to build your own ThreeJS 3D Developer Portfolio today!

Home Page:https://jsmastery.pro

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Toggle not working Navbar.jsx

Harsh-Ojha opened this issue · comments

Screenshot 2023-08-31 131500

The toggle function is not working, and I am unable to close or open the list manually. Please suggest some solution.

commented

@Harsh-Ojha you have to use ` ( backtick: the key to the left of the 1 in standard keyboards) instead of ' (single quote)

             <li
              key={Link.id}
              className={`${
                active === Link.title
                ? "text-white"
                : "text-secondary"
              } hover:text-white text-[18px] font-medium cursor-pointer`}
              onClick={()=> setActive(Link.title)}
              >
              <a href={`#${Link.id}`}>{Link.title}</a>
            </li>

@Harsh-Ojha you have to use ` ( backtick: the key to the left of the 1 in standard keyboards) instead of ' (single quote)

             <li
              key={Link.id}
              className={`${
                active === Link.title
                ? "text-white"
                : "text-secondary"
              } hover:text-white text-[18px] font-medium cursor-pointer`}
              onClick={()=> setActive(Link.title)}
              >
              <a href={`#${Link.id}`}>{Link.title}</a>
            </li>

Thanks @Tusharknwl, it worked for me.