Fix link component

This commit is contained in:
Robert Long 2022-01-06 13:14:15 -08:00
parent 627c64dca3
commit aa6bbbaaa0

View file

@ -176,17 +176,19 @@ export const Micro = forwardRef(
export const Link = forwardRef( export const Link = forwardRef(
( (
{ {
as: Component = RouterLink, as,
children, children,
className, className,
color = "link", color = "link",
href, href,
to,
fontWeight, fontWeight,
overflowEllipsis, overflowEllipsis,
...rest ...rest
}, },
ref ref
) => { ) => {
const Component = as || (to ? RouterLink : "a");
let externalLinkProps; let externalLinkProps;
if (href) { if (href) {
@ -200,6 +202,7 @@ export const Link = forwardRef(
<Component <Component
{...externalLinkProps} {...externalLinkProps}
{...rest} {...rest}
to={to}
className={classNames( className={classNames(
styles[color], styles[color],
styles[fontWeight], styles[fontWeight],