mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-03 12:17:20 +02:00
fix(v2): remove invalid label attribute of footer links (#1980)
* fix(v2): remove invalid attributes of footer links * Add rest props * Fix override props
This commit is contained in:
parent
137e548aef
commit
9cbb7030fa
1 changed files with 8 additions and 8 deletions
|
@ -13,22 +13,22 @@ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
|
|||
import useBaseUrl from '@docusaurus/useBaseUrl';
|
||||
import styles from './styles.module.css';
|
||||
|
||||
function FooterLink({item}) {
|
||||
const toUrl = useBaseUrl(item.to);
|
||||
function FooterLink({to, href, label, ...props}) {
|
||||
const toUrl = useBaseUrl(to);
|
||||
return (
|
||||
<Link
|
||||
className="footer__link-item"
|
||||
{...item}
|
||||
{...(item.href
|
||||
{...(href
|
||||
? {
|
||||
target: '_blank',
|
||||
rel: 'noopener noreferrer',
|
||||
href: item.href,
|
||||
href,
|
||||
}
|
||||
: {
|
||||
to: toUrl,
|
||||
})}>
|
||||
{item.label}
|
||||
})}
|
||||
{...props}>
|
||||
{label}
|
||||
</Link>
|
||||
);
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ function Footer() {
|
|||
/>
|
||||
) : (
|
||||
<li key={item.href || item.to} className="footer__item">
|
||||
<FooterLink item={item} />
|
||||
<FooterLink {...item} />
|
||||
</li>
|
||||
),
|
||||
)}
|
||||
|
|
Loading…
Add table
Reference in a new issue