You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello 😄 first of all, amazing package, thank you for releasing and maintaining it.
I've noticed that when I try and define the return type of the getStaticProps() function (Next.js), if I use an interface that defines the contentType I get a typescript error on the contentType.sys.id property, complaining that type string is incompatible with the string literal (in my example, "city").
For now, I'm asserting the type in the return statement to make the error go away - which isn't much of an inconvenience tbh. Is this the correct solution?
return {
props: {
cities: cities.items as ICity[]
}
}
The text was updated successfully, but these errors were encountered:
Hello 😄 first of all, amazing package, thank you for releasing and maintaining it.
I've noticed that when I try and define the return type of the
getStaticProps()
function (Next.js), if I use an interface that defines thecontentType
I get a typescript error on thecontentType.sys.id
property, complaining that type string is incompatible with the string literal (in my example,"city"
).Here's the code snippet:
And a snapshot of the error:
For now, I'm asserting the type in the return statement to make the error go away - which isn't much of an inconvenience tbh. Is this the correct solution?
The text was updated successfully, but these errors were encountered: