You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have tried a lot of times to switch the Home sidebar but it always shows active on the other hand all other sidebar switches nicely. Anyone help to figure me it out? Here is my GitHub code link share-me
`
import { NavLink, Link } from 'react-router-dom';
import { RiHomeFill } from 'react-icons/ri';
import { IoIosArrowForward } from 'react-icons/io';
So this worked for me i just added "end" before "to="/" like this:
<NavLink
end
to="/"
className={({ isActive }) =>
isActive ? isActiveStyle : isNotActiveStyle
}
onClick={handleCloseSidebar}
>
I have tried a lot of times to switch the Home sidebar but it always shows active on the other hand all other sidebar switches nicely. Anyone help to figure me it out? Here is my GitHub code link share-me
`
import { NavLink, Link } from 'react-router-dom';
import { RiHomeFill } from 'react-icons/ri';
import { IoIosArrowForward } from 'react-icons/io';
import logo from '../assets/logo.png';
const categories = [
{ name: 'Animals' },
{ name: 'Wallpapers' },
{ name: 'Photography' },
{ name: 'Gaming' },
{ name: 'Coding' },
{ name: 'Other' },
];
const isNotActiveStyle =
'flex items-center px-5 gap-3 text-gray-500 hover:text-black transition-all duration-200 ease-in-out capitalize';
const isActiveStyle =
'flex items-center px-5 gap-3 font-extrabold border-r-2 border-black transition-all duration-200 ease-in-out capitalize';
const Sidebar = ({ user, closeToggle }) => {
const handleCloseSidebar = () => {
if (closeToggle) closeToggle(false);
};
};
export default Sidebar;
`
The text was updated successfully, but these errors were encountered: