RouteData['fields'] only returns the Field type. However, this type definition is insufficient if your route has a ContentList field...
const fields: RouteData['fields'] = {
pageTitle: {value: 'Reasons to use our service'}, // Field - this is currently supported
canonicalUrl: {value: {href: '/reasons-to-use-our-service'}}, // Field
// Item[] - this will result in a type error
robots: [
{
name: 'nofollow',
displayName: 'nofollow',
fields: {
name: {
value: 'nofollow'
},
value: {
value: 'nofollow'
},
},
// I noticed that these fields come back from Sitecore but aren't in the type def either
id: '',
url: '',
}
]
}
Expected behavior
I think that RouterData['fields'] should return Field | Item[].
Description
RouteData['fields']
only returns theField
type. However, this type definition is insufficient if your route has a ContentList field...Expected behavior
I think that
RouterData['fields']
should returnField | Item[]
.Possible Fix
Your Environment