As a newcomer to Typescript, I am facing challenges in properly typing the following code snippet. I have experimented with Interfaces and individually typing properties as well, but it seems like I am only scratching the surface and encountering new typing errors.
I believe one of the main issues lies in typing the map function and the nested objects/values within it. What is the best approach to tackle this?
export function Navigation( { navigation } ) {
return (
<nav>
<ul>
{navigation.data.slices.map( ( slice ) => {
return (
<li key={slice.id}>
<PrismicLink field={slice.primary.menu_item_link}>
{slice.primary.menu_item_label}
</PrismicLink>
</li>
)
})}
</ul>
</nav>
)
}