I'm using NextJS 13 and TypeScript and want to create a multilanguage website, but when I want to get a prop from internalLinkComponent on PrismicProvider I get an error that locale does not exist on the props.
TS2322: Type '({ href, children, locale, ...props }: { href: string; children: ReactNode; locale: any; }) => JSX.Element' is not assignable to type 'ElementType<LinkProps> | undefined'.<br/>Type '({ href, children, locale, ...props }: { href: string; children: ReactNode; locale: any; }) => JSX.Element' is not assignable to type 'FunctionComponent<LinkProps>'.<br/>Types of parameters '__0' and 'props' are incompatible.<br/>Property 'locale' is missing in type 'LinkProps' but required in type '{ href: string; children: ReactNode; locale: any; }'.
Is there any way I can pass that TypeScript errors?
Here is my PrismicProvider call inside _app.tsx file, that is mentioned on this Prismic documentation page, but I get an error that I already mentioned above:
I see. Looking at the original error, it says that the locale property is missing in the LinkProps type, but it's required in the internalLinkComponent you're passing to the PrismicProvider. You can try and add a custom LinkProps that includes the locale property and use that interface instead of the default LinkProps interface.