Skip to content

Commit

Permalink
fix(v2): remove invalid attributes of nav links (#1974)
Browse files Browse the repository at this point in the history
* fix(v2): remove nav links invalid attributes

* Refactor: add remaining props
  • Loading branch information
lex111 authored and endiliey committed Nov 13, 2019
1 parent ffa6b71 commit 95e9963
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions packages/docusaurus-theme-classic/src/theme/Navbar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,23 @@ import useTheme from '@theme/hooks/useTheme';

import styles from './styles.module.css';

function NavLink(props) {
const toUrl = useBaseUrl(props.to);
function NavLink({to, href, label, position, ...props}) {
const toUrl = useBaseUrl(to);
return (
<Link
className="navbar__item navbar__link"
{...props}
{...(props.href
{...(href
? {
target: '_blank',
rel: 'noopener noreferrer',
href: props.href,
href,
}
: {
activeClassName: 'navbar__link--active',
to: toUrl,
})}>
{props.label}
})}
{...props}>
{label}
</Link>
);
}
Expand Down

0 comments on commit 95e9963

Please sign in to comment.