Skip to content

Commit

Permalink
fix: allow href, target overrides in PrismicLink
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Jul 1, 2021
1 parent 8058fe1 commit b0037f5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/PrismicLink.tsx
Expand Up @@ -63,9 +63,12 @@ export const PrismicLink = <
"";

const target =
(props.field && "target" in props.field && props.target) || undefined;
props.target ||
(props.field && "target" in props.field && props.field.target) ||
undefined;

const rel = target === "_blank" ? "noopener noreferrer" : undefined;
const rel =
props.rel || target === "_blank" ? "noopener noreferrer" : undefined;

const InternalComponent =
props.internalComponent ||
Expand Down

0 comments on commit b0037f5

Please sign in to comment.