Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit 10aa79c

Browse files
committed
fix: don't pass linkComponent to HTML element
1 parent f7f11c8 commit 10aa79c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/HoverOverlay.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ import { toPrettyBlobURL } from './url'
1818
*/
1919
const ButtonOrLink: React.StatelessComponent<
2020
{ linkComponent: React.ComponentType<{ to: string }>; to?: string } & React.HTMLAttributes<HTMLElement>
21-
> = props => {
22-
const Link = props.linkComponent
23-
return props.to ? (
24-
<Link to={props.to} {...props}>
25-
{props.children}
21+
> = ({ linkComponent, to, children, ...rest }) => {
22+
const Link = linkComponent
23+
return to ? (
24+
<Link to={to} {...rest}>
25+
{children}
2626
</Link>
2727
) : (
28-
<button {...props}>{props.children}</button>
28+
<button {...rest}>{children}</button>
2929
)
3030
}
3131

0 commit comments

Comments
 (0)