Skip to content

Commit 0d510d1

Browse files
committed
Empty link is not external
1 parent 6fcb0ef commit 0d510d1

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

src/app/conf/_design-system/anchor.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,15 @@ export const Anchor = forwardRef(function Anchor(
2828
) : (
2929
<a
3030
ref={ref}
31-
{...(!// we want to show an error if developer doesn't pass a href, but there are cases where it may happen with data from Sched
32-
(props.href as string | undefined)?.startsWith("#")
33-
? {
34-
rel: "noopener noreferrer",
35-
target: "_blank",
36-
}
37-
: {})}
31+
{
32+
// we want to show an error if developer doesn't pass a href, but there are cases where it may happen with data from Sched
33+
...(((props.href as string | undefined) || "").startsWith("#")
34+
? {
35+
rel: "noopener noreferrer",
36+
target: "_blank",
37+
}
38+
: {})
39+
}
3840
{...props}
3941
/>
4042
)

0 commit comments

Comments
 (0)