<tdv-for="value in currentRecord":key="recordId">
{{ value.displayText ? value.displayText : value }}
Seems innocent enough right? Well, TypeScript had something to say about that, quote: 'value' is of type 'unknown'. ts(18046). My first thought was to type value but there seems to be no way to do this inside the template portion of a single file component.
Because the value could be a string or a number, TypeScript will say, Property 'displayText' does not exist on type 'string | number | { id: number; displayText: string; }'.
Property 'displayText' does not exist on type 'string'.ts(2339)
Fair enough 🥺 - So what to do... The final piece of the puzzle is to check whether value is an object and only then grab displayText, like so: