I use the PrismicRichText
component to render my RichText fields. As instructed by your documentation, I am attempting to use my own CustomLink component to handle hyperlinks like so:
<PrismicRichText
field={article.data.body?.richText}
components={{
hyperlink: ({ node, children }) =>
CustomLink({ node, children }),
}}
/>
However, in this situation, node
is of type RTLinkNode
. Unfortunately, this type is not exported by Prismicio and there is no other reference to this type anywhere in the code. This poses a problem with TypeScript as in order to accept that link node in my CustomLink
component, I must declare node
as any
.
This is not ideal for using typescript as using any
makes the point of using typescript pointless.
Please provide support for all typescript types that are used.