Toggle not working Navbar.jsx
Harsh-Ojha opened this issue · comments
Harsh-Ojha commented
Tushar 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 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>
Thanks @Tusharknwl, it worked for me.