I have been using Typescript with React from a while. I have a scenario where my type definition is similar to this
type Attributes: {
industries: [];
regions: [];
products: [];
[key: string]: [];
}
The top three props are consistent while the last one can be areaTypes or categories.
Now when I map through these props I can read the data of the top three props as their names are consistent but when I want the value for the dictionary prop I have to give the name of that specific prop in order to read it.
<ul>
{props.areaTypes.map((item) => (
<li>{item}</li>
))}
</ul>
I want to know if there is any other efficient way to read values of dictionary type, so I don't have to type in the name of the unknown props each time to map it.