Skip to content

Commit

Permalink
refactor(breadcrumb): ♻️ isExternal variable
Browse files Browse the repository at this point in the history
  • Loading branch information
navin-moorthy committed Sep 8, 2020
1 parent 7e07ce8 commit 3eaf984
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/link/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,10 @@ export const useLink = createHook<LinkOptions, LinkHTMLProps>({
}
}, []);

let externalLinkProps = {};

if (isExternal) {
externalLinkProps = { target: "_blank", rel: "noopener noreferrer" };
}

return {
ref: useForkRef(ref, htmlRef),
role,
...externalLinkProps,
...(isExternal && { target: "_blank", rel: "noopener noreferrer" }),
...htmlProps,
};
},
Expand Down

0 comments on commit 3eaf984

Please sign in to comment.