Open thompsongl opened 1 year ago
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: https://github.com/prismicio/prismic-react/pull/146
Remarks: In the reproduction, 2 TypeScript versions are installed:
4.9.5
and4.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 TypeScript4.8.4
and4.7.4
.
We'll publish a fix soon ☺️
Versions
Reproduction
https://codesandbox.io/s/modern-shadow-2tqpqb?file=/src/App.tsx
Steps to reproduce
1) Go to the repro link 2) See the TypeScript errors 3) Change the
@prismicio/react
version tov2.1.2
4) See the TypeScript errors disappearWhat is expected?
@prismicio/react@2.5.1
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.