onNavigate
Callback function for router integration.
When a side nav item link is clicked, this function is called and the default click action is cancelled. This delegates the responsibility of navigation to the function's logic.
The click event action is not cancelled in the following cases:
The click event has a modifier (e.g.
metaKey,shiftKey)The click event is on an external link
The click event is on a link with
target="_blank"The function explicitly returns
false
The function receives an object with the properties of the clicked side-nav item:
path: The path of the navigation item.target: The target of the navigation item.current: A boolean indicating whether the navigation item is currently selected.expanded: A boolean indicating whether the navigation item is expanded.pathAliases: An array of path aliases for the navigation item.originalEvent: The original DOM event that triggered the navigation.
Also see the location property for updating the highlighted navigation item on route change.