Skip to content

Commit

Permalink
For #4707 (#4708)
Browse files Browse the repository at this point in the history
Line 32 has to be `aria-current` instead of `ariaCurrent`, otherwise React will strip it out.
  • Loading branch information
JasonEtco authored and timdorr committed Jul 5, 2017
1 parent 64f0aec commit 89093a4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/react-router-dom/modules/NavLink.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ const NavLink = ({
activeStyle,
style,
isActive: getIsActive,
ariaCurrent,
...rest
}) => (
<Route
Expand All @@ -31,6 +32,7 @@ const NavLink = ({
to={to}
className={isActive ? [ className, activeClassName ].filter(i => i).join(' ') : className}
style={isActive ? { ...style, ...activeStyle } : style}
aria-current={isActive && ariaCurrent}
{...rest}
/>
)
Expand All @@ -47,11 +49,13 @@ NavLink.propTypes = {
className: PropTypes.string,
activeStyle: PropTypes.object,
style: PropTypes.object,
isActive: PropTypes.func
isActive: PropTypes.func,
ariaCurrent: PropTypes.oneOf(['page', 'step', 'location', 'true'])
}

NavLink.defaultProps = {
activeClassName: 'active'
activeClassName: 'active',
ariaCurrent: 'true'
}

export default NavLink

0 comments on commit 89093a4

Please sign in to comment.