coreui / coreui-free-react-admin-template

Open source admin template based on Bootstrap 5 and React.js
https://coreui.io/product/free-react-admin-template/
MIT License
4.6k stars 2.33k forks source link

Sidebar not setting active #380

Closed diegogangl closed 2 years ago

diegogangl commented 2 years ago

I can't get the sidebar to mark navitems as active once I click on them. This should be automatic right? Or is there some prop I need to set somehow?

            <CSidebarNav>
                <CNavItem href="/">
                    <CIcon customClassName="nav-icon" icon={cilSpeedometer} />
                    Inicio
                </CNavItem>
                <CNavItem href="/events">
                    <CIcon customClassName="nav-icon" icon={cilListRich} />
                    Eventos
                </CNavItem>
            </CSidebarNav>
github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

maksumon commented 2 years ago

You need to use active props in the CNavItem component.