diff --git a/playbook/app/pb_kits/playbook/pb_link/_link.tsx b/playbook/app/pb_kits/playbook/pb_link/_link.tsx index 49310fa81e..ff57ef3767 100644 --- a/playbook/app/pb_kits/playbook/pb_link/_link.tsx +++ b/playbook/app/pb_kits/playbook/pb_link/_link.tsx @@ -52,9 +52,9 @@ const Link = (props: LinkProps): React.ReactElement => { globalProps(props), className ) - const Tag: keyof JSX.IntrinsicElements = `${tag}` + const Tag = tag as keyof JSX.IntrinsicElements - const content = ( + const renderContent = () => ( <> {icon && ( { ) + const commonProps = { + ...ariaProps, + ...dataProps, + ...htmlProps, + className: classes, + id, + } + if (tag === 'a') { return ( - - {content} - + {renderContent()} + ) } else { return ( - - {content} - + {renderContent()} ) }