You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trying to upgrade @prismicio/react to the latest version is blocked on type errors related to internalLinkComponent and externalLinkComponent:
Type '({ href, target, children, rel }: { href: any; target: any; children: any; rel: any; }) => Element' is not assignable to type '"a"'.
I have not been able to find a workaround (aside from type casting) or update to the PrismicLinkProps interface that accommodates custom components and DOM tag names.
The text was updated successfully, but these errors were encountered:
Hey there, thanks for submitting an issue with a comprehensive reproduction!
I managed to reproduce and narrow the problematic version to version 2.3.0, see: #146
Remarks:
In the reproduction, 2 TypeScript versions are installed: 4.9.5 and 4.1.3, the latter being 2+ years old. However, it looks like it wasn't the one picked up, not impacting the reproduction. I reproduced the issue again with TypeScript 4.8.4 and 4.7.4.
Versions
Reproduction
https://codesandbox.io/s/modern-shadow-2tqpqb?file=/src/App.tsx
Steps to reproduce
@prismicio/react
version tov2.1.2
What is expected?
@prismicio/[email protected]
should not have the type errorsWhat is actually happening?
Trying to upgrade
@prismicio/react
to the latest version is blocked on type errors related tointernalLinkComponent
andexternalLinkComponent
:Type '({ href, target, children, rel }: { href: any; target: any; children: any; rel: any; }) => Element' is not assignable to type '"a"'.
I have not been able to find a workaround (aside from type casting) or update to the
PrismicLinkProps
interface that accommodates custom components and DOM tag names.The text was updated successfully, but these errors were encountered: