Skip to content

Commit

Permalink
fix: remove @ts-expect-error
Browse files Browse the repository at this point in the history
  • Loading branch information
angeloashmore committed Apr 5, 2023
1 parent fe73dc0 commit 2b420c0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/rsc/PrismicLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ const _PrismicLink = <
config.externalLinkComponent ||
defaultExternalComponent;

const Component = isInternal ? InternalComponent : ExternalComponent;
const Component = (
isInternal ? InternalComponent : ExternalComponent
) as React.ComponentType<LinkProps>;

const passthroughProps: typeof props = Object.assign({}, props);
delete passthroughProps.linkResolver;
Expand All @@ -226,11 +228,6 @@ const _PrismicLink = <

return href ? (
<Component
// @ts-expect-error - Expression produces a union type
// that is too complex to represent. This most likely
// happens due to the polymorphic nature of this
// component, passing of "extra" props, and ref
// forwarding support.
{...passthroughProps}
ref={ref}
href={href}
Expand Down

0 comments on commit 2b420c0

Please sign in to comment.