How can i fix this:
Property 'uid' does not exist on type 'ContentRelationshipField<"social_media">'.
Property 'uid' does not exist on type 'EmptyLinkField<"Document">'.ts(2339)
any
Thank you!
How can i fix this:
Property 'uid' does not exist on type 'ContentRelationshipField<"social_media">'.
Property 'uid' does not exist on type 'EmptyLinkField<"Document">'.ts(2339)
any
Thank you!
Can I encourage you to see this thread? I believe it's related:
Types for content relationship in a Slice - Developing with Prismic - Prismic People
nf_mastroianniNeil Thank you for the link,
Tried it but i'm new to TS, hard to know how to do it correctly, can you please help?
Hi, you have to declare socialMediaUID in condition:
if (isFilled.contentRelationship(slice.primary.social_media)) {
socialMediaUID = slice.primary.social_media.uid
}
The UID exist if the field is not empty.
Thank you very much !!