coreui/coreui-react

Nav Links Not Working

jpwalters opened this issue · 2 comments

  • Operating system: Windows 11
  • Browser: Chrome
  • Branch: v5

BUG: The navigation links aren't working. You can open a node but when you attempt to click a link like Accordion, Cards, List Group, etc. nothing happens. If I modify the url manually the page for example http://localhost:3000/#/base/accordion the page loads normally.

image

Work Around: In the _nav.js file if you change the property to: to be href: all the navigation links will work as expected again. Plus you have to add # in front of each url.

mman commented

Thanks @jpwalters for this report and suggested workaround. Can confirm that your fix works victronenergy/venus-influx-loader@2c55b47.

However not sure what has changed and why to: no longer works.

CNavLink param to is marked as @ignore since 4.0.

export interface CNavLinkProps extends Omit<CLinkProps, 'idx'> {
/**
* @ignore
*/
idx?: string
/**
* @ignore
*/
to?: string
}

which is why it does not show at all in the official docs for CNavLink.

https://coreui.io/react/docs/components/navs-tabs/#cnavlink

Anyway, where does the trick with prepending the href with # comes from?