We're using Typescript in our Next.js project.
Slice item props that are unique to a slice variation are 'not found'.
We are declaring a slice props type as per below:
export type ContentFeaturesProps =
SliceComponentProps<Content.ContentFeaturesSlice>
Within this slice we have a default variation and an "with icon" variation.
I can see that the type is generated and declared in prismicio.d.ts as:
type ContentFeaturesSliceVariation = ContentFeaturesSliceDefault | ContentFeaturesSliceContentFeaturesWithIcons;
In development / build, we get the below error:
Type error: Property 'icon' does not exist on type 'Simplify<ContentFeaturesSliceDefaultItem> | Simplify<ContentFeaturesSliceContentFeaturesWithIconsItem>'.
Property 'icon' does not exist on type 'Simplify<ContentFeaturesSliceDefaultItem>'.
Should we be referencing a different type for the slice?
Javascript typedefs work fine, not typescript types.
/**
* @typedef {import("@prismicio/client").Content.ContentFeaturesSlice} ContentFeaturesSlice
* @typedef {import("@prismicio/react").SliceComponentProps<ContentFeaturesSlice>} ContentFeaturesProps
* @param { ContentFeaturesProps }
*
Please advise.