Fix link component
This commit is contained in:
parent
627c64dca3
commit
aa6bbbaaa0
1 changed files with 4 additions and 1 deletions
|
@ -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],
|
||||||
|
|
Loading…
Reference in a new issue