Skip to content

Commit cd4a939

Browse files
committed
add: rel prop support to Link
To enable the link component to be used by Shopify app navMenu Links
1 parent ac6fb70 commit cd4a939

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

polaris-react/src/components/Link/Link.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ export interface LinkProps {
1818
* @deprecated use `target` set to `_blank` instead
1919
*/
2020
external?: boolean;
21+
/** The relationship of the linked URL as space-separated link types. */
22+
rel?: string;
2123
/** Where to display the url */
2224
target?: Target;
2325
/** Makes the link color the same as the current text color and adds an underline */
@@ -37,6 +39,7 @@ export function Link({
3739
children,
3840
onClick,
3941
external,
42+
rel,
4043
target,
4144
id,
4245
monochrome,
@@ -60,6 +63,7 @@ export function Link({
6063
onClick={onClick}
6164
className={className}
6265
url={url}
66+
rel={rel}
6367
external={external}
6468
target={target}
6569
id={id}

polaris-react/src/components/UnstyledLink/UnstyledLink.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const UnstyledLink = memo(
3131
target = targetProp ?? undefined;
3232
}
3333

34-
const rel = target === '_blank' ? 'noopener noreferrer' : undefined;
34+
const rel = props.ref ?? target === '_blank' ? 'noopener noreferrer' : undefined;
3535

3636
return (
3737
<a

0 commit comments

Comments
 (0)