Skip to content

Commit e45cb32

Browse files
committed
link - Route links starting with http through regular links
We still might want to add support for special cases like // etc. later. This will do for now. Closes #251.
1 parent 9aa27d7 commit e45cb32

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

components/link/link.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import React from 'react';
2+
import startsWith from 'lodash/startsWith';
23

34
let RRouter;
45
if (__DEV__) {
56
RRouter = require('react-router');
67
}
78

89
const Link = ({ to, ...props }) => {
9-
if (__DEV__) {
10+
if (__DEV__ && !startsWith(to, 'http')) {
1011
return <RRouter.Link to={to} {...props} />;
1112
}
1213

0 commit comments

Comments
 (0)