Greetings all! I am forcing myself to ride the struggle bus via the App router and also making myself learn typescript along the way. I need some guidance on a specific problem. In the old Pages routing system, we used the _app file and the PrismicProvider component. This allowed us (me) to:
<PrismicProvider
internalLinkComponent={props => <Link {...props} />}
richTextComponents={richTextComponents} // <-- this is the part I'm asking about
>
<Component {...pageProps} />
</PrismicProvider>
Notice how we could define a default set of components for the PrismicRichText component for our slices? I've created a separate file called richTextComponents.ts in a lib file and I'm ok with passing it to PrismicRichText whenever I need it...however, when I turn it to TS from JS, I get hella (remember when people said hella? haha) warnings.
'Heading' refers to a value, but is being used as a type here. Did you mean 'typeof Heading'?
Here's a sample of my richTextComponents file:
import { Heading } from '@/components/Heading'
import { PrismicLink } from '@prismicio/react'
export const richTextComponents = {
heading1: ({ children }) => (
<Heading as="h1" size="5xl">
{children}
</Heading>
),
heading2: ({ children }) => (
<Heading as="h2" size="4xl">
{children}
</Heading>
),
Any thoughts?