Skip to content

Commit 1f3b5f1

Browse files
WesSouzaarturbien
authored andcommitted
chore(anchor): compose type with CommonStyledProps
This exposes the `as` property so users can swap the element as allowed by styled-components.
1 parent f63cbe5 commit 1f3b5f1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/Anchor/Anchor.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, { forwardRef } from 'react';
2+
import { CommonStyledProps } from 'src/types';
23

34
import styled from 'styled-components';
45

@@ -11,9 +12,10 @@ const StyledAnchor = styled.a`
1112
}
1213
`;
1314

14-
interface AnchorProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
15+
type AnchorProps = {
1516
children: React.ReactNode;
16-
}
17+
} & React.AnchorHTMLAttributes<HTMLAnchorElement> &
18+
CommonStyledProps;
1719

1820
const Anchor = forwardRef<HTMLAnchorElement, AnchorProps>(function Anchor(
1921
{ children, ...otherProps }: AnchorProps,

0 commit comments

Comments
 (0)