diff --git a/src/ui/link/index.tsx b/src/ui/link/index.tsx index 9a598652..ac8c8d49 100644 --- a/src/ui/link/index.tsx +++ b/src/ui/link/index.tsx @@ -72,9 +72,9 @@ const Link = forwardRef( )) || '' : to; - const IS_EXTERNAL_LINK_REGEX = /^(?:(http|https):\/\/)/; + const IS_ABSOLUTE_LINK_REGEX = /^(?:(http|https):\/\/)/; const staticBasePath = - (href != null && !IS_EXTERNAL_LINK_REGEX.test(href)) || typeof to === 'string' ? routeAttributes.basePath : ''; + (href != null && !IS_ABSOLUTE_LINK_REGEX.test(href)) || typeof to === 'string' ? routeAttributes.basePath : ''; const triggerPrefetch = useCallback(() => { // ignore if async route not ready yet diff --git a/src/ui/link/test.tsx b/src/ui/link/test.tsx index bdcf228c..ec628ba5 100644 --- a/src/ui/link/test.tsx +++ b/src/ui/link/test.tsx @@ -105,7 +105,7 @@ describe('', () => { ); }); - it('should not add basePath for external links', () => { + it('should not add basePath for absolute links', () => { renderInRouter( 'my link', {