Skip to content

Commit 7457673

Browse files
committed
Open external links in separate tabs
1 parent e45cb32 commit 7457673

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/link/link.jsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ if (__DEV__) {
77
}
88

99
const Link = ({ to, ...props }) => {
10-
if (__DEV__ && !startsWith(to, 'http')) {
10+
if (startsWith(to, 'http') || startsWith(to, '//')) {
11+
return <a href={to} target="_blank" {...props} />;
12+
}
13+
14+
if (__DEV__) {
1115
return <RRouter.Link to={to} {...props} />;
1216
}
1317

0 commit comments

Comments
 (0)