Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

217
Vistas
React-Typescript - Mapping props with dictionary type

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.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda