NavLink
#
This component extends extends NavLink
of react-router-dom. It provides additional props for preventing refresh of current route.
#
Example#
PropsExtends react-router-dom
NavLink
props
Additional props:
Name | Type | Default | Required | Description |
---|---|---|---|---|
noRefresh | boolean | false | No | If true and link is active, prevents refresh when clicking. |
safeOnClick | function | No | Onclick 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 | |
onActive | function | No | Event fired when active state changes.(active: boolean) => void |