Skip to content

Commit e32ae5b

Browse files
committed
fix: OutgoingLinks isExternal defaults to true
1 parent 7ce4555 commit e32ae5b

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/links.test.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ describe('Links', () => {
2929
const element = getByTestId('link')
3030
expect(element.tagName).toEqual('A')
3131
expect(element).toHaveAttribute('href', '/foo')
32+
expect(element).toHaveAttribute('target', '_blank')
33+
expect(element).toHaveAttribute('rel', 'noopener noreferrer')
3234
})
3335

3436
test('ButtonRouteLink', () => {

src/components/links.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@ export interface OutgoingLinkProps extends ChakraLinkProps {
3636

3737
export const OutgoingLink: React.FC<OutgoingLinkProps> = ({
3838
children,
39+
isExternal = true,
3940
showExternalIcon = false,
4041
...props
4142
}) => {
4243
return (
43-
<ChakraLink {...props}>
44+
<ChakraLink isExternal={isExternal} {...props}>
4445
{children}
4546
{showExternalIcon && (
4647
<Icon

0 commit comments

Comments
 (0)