NavLink#

This component extends extends NavLink of react-router-dom. It provides additional props for preventing refresh of current route.

Example#

import { NavLink } from 'la-danze-ui';
function App() {
return (
...
<NavLink to="/" exact title="Home" noRefresh />
...
);
}

Props#

Extends react-router-dom NavLink props

Additional props:

NameTypeDefaultRequiredDescription
noRefreshbooleanfalseNoIf true and link is active, prevents refresh when clicking.
safeOnClickfunctionNoOnclick event fired only when there is a route change by clicking on link (if noRefresh = true and link is active, event will not be fired).
(event: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void
onActivefunctionNoEvent fired when active state changes.
(active: boolean) => void